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