Пример #1
0
    private void InitGame()
    {
        // keep this object alive
        DontDestroyOnLoad(this.gameObject);

        // init nemuManager ref
        if (!menuManager)
        {
            menuManager = MenuManager_TapToKill.Instance;
        }

        // chack playerManager ref
        if (!playerManager)
        {
            playerManager = PlayerManager_TapToKill.Instance;
        }

        // init soundManager
        if (!soundManager)
        {
            soundManager = BaseSoundController.Instance;
        }

        // init musicManager
        if (!musicManager)
        {
            musicManager = BaseMusicController.Instance;
        }

        // initialize a timer
        theTimer = ScriptableObject.CreateInstance <TimerClass>();
    }
Пример #2
0
 // main event
 void Awake()
 {
     // activate instance
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }