Example #1
0
 // main event
 void Awake()
 {
     // activate instance
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Example #2
0
    // main logic
    private void InitGame()
    {
        // init nemuManager ref
        if (!menuManager)
        {
            menuManager = MenuManager_Basket.Instance;
        }

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

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

        // initialize a timer
        theTimer = ScriptableObject.CreateInstance <TimerClass>();
    }