Exemple #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>();
    }
Exemple #2
0
    public override void Init()
    {
        // keep this object alive
        DontDestroyOnLoad(this.gameObject);

        base.Init();

        // init instance
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }
    }