Example #1
0
 void OpenProxies()
 {
     LoggerProxy.Open(m_Logger);
     UpdaterProxy.Open(m_Updater);
     GameEventManagerProxy.Open(m_GameEventManager);
     InputManagerProxy.Open(m_InputManager);
     LevelManagerProxy.Open(m_LevelManager);
     SoundManagerProxy.Open(m_SoundManager);
 }
Example #2
0
    // This should be called before any other gameobject awakes
    private void Awake ()
    {
        // Singleton pattern : this is the only case where it should be used
        if(ms_Instance == null)
        {
            ms_Instance = this;
            DontDestroyOnLoad (gameObject);
            
            // Keep the Updater first, as the other members might want to register to it
            m_Logger = new UnityLogger ();
            LoggerProxy.Open (m_Logger);
            m_Updater = new Updater ();
            UpdaterProxy.Open (m_Updater);
            m_GameEventManager = new GameEventManager ();
            GameEventManagerProxy.Open (m_GameEventManager);
            m_InputManager = new InputManager ();
            InputManagerProxy.Open (m_InputManager);
            m_LevelManager = new LevelManager ();
            LevelManagerProxy.Open (m_LevelManager);
            m_TileManager = new TileManager ();
            TileManagerProxy.Open (m_TileManager);
            m_CommandStack = new CommandStack ();
            CommandStackProxy.Open (m_CommandStack);
            m_GoalManager = new GoalManager ();
            GoalManagerProxy.Open (m_GoalManager);
            m_SoundManager = new SoundManager ();
            SoundManagerProxy.Open (m_SoundManager);
            m_SoundManager.SetMusicSource (m_MusicSource);
            m_SoundManager.SetFXSource (m_EfxSource);

            m_GameFlowHSM = new GameFlowHSM ();
            m_GameFlowHSM.Start (typeof (GameFlowMenuState));
        }
        else if (ms_Instance != this)
        {
            Destroy (gameObject);
            return;
        }
    }