예제 #1
0
 void Awake()
 {
     // Make this an indestructible singleton
     if (Instance == null)
     {
         Instance = this;
     }
     else if (!Instance.Equals(this))
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
예제 #2
0
        void Start()
        {
            Faider = ScreenFaider.Instance;

            Faider.FadeOut(FadeSpeed, delegate
            {
                loading = false;
                if (AutoLoad)
                {
                    DelayedAction(AutoLoadTime, delegate
                    {
                        LoadScene(ExitScene);
                    });
                }
            });
        }
예제 #3
0
 /// <summary>
 /// Destroy this singleton instance
 /// </summary>
 public static void DestroySingleton()
 {
     Destroy(Instance.gameObject);
     Instance = null;
 }