コード例 #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     fadeScreen = GameObject.Find("ScreenFade").GetComponent <Image>();
     canvas     = GameObject.Find("UI Canvas").GetComponent <CanvasVisibility>();
 }