Delay.cs 320 B

12345678910111213141516171819
  1. using UnityEngine;
  2. using System.Collections;
  3. public class Delay : MonoBehaviour {
  4. public float delayTime = 1.0f;
  5. // Use this for initialization
  6. void Start () {
  7. gameObject.SetActiveRecursively(false);
  8. Invoke("DelayFunc", delayTime);
  9. }
  10. void DelayFunc()
  11. {
  12. gameObject.SetActiveRecursively(true);
  13. }
  14. }