例えばあるGameObjectにこのようなスクリプトがある。
Start時にStartのログが出る。
using UnityEngine; using System.Collections; public class Spark : MonoBehaviour { // Use this for initialization void Start () { Debug.Log("Start"); } }
それに対して
public GameObject go; // Use this for initialization void Start () { Invoke ("MekeFalse", 0.7f); Invoke ("MekeTrue", 1.7f); } void MekeFalse() { Debug.Log ("MekeFalse"); go.SetActive(false); } void MekeTrue () { Debug.Log ("MekeTrue"); go.SetActive(true); }
をしてみたが、
Start MekeFalse MekeTrue
一度しかStartがログに出なかった。