Esempio n. 1
0
    public IEnumerator EndPlay_Co()
    {
        yield return(m_GameMode.StartCoroutine(HandleBeforeEndPlay_Co()));

        m_GameState.Dispose();
        m_GameState = null;
        Destroy(m_GameMode);
        m_GameMode = null;

        m_Level = null;
        yield return(m_GameMode.StartCoroutine(HandleAfterEndPlay_Co()));
    }
Esempio n. 2
0
    public IEnumerator BeginPlay_Co()
    {
        yield return(StartCoroutine(HandleBeforeBeginPlay_Co()));

        m_Level = hwmSystem.GetInstance().GetWaitingToPlayLevel();
        hwmDebug.Assert(m_Level != null, "m_Level != null");

        m_GameState = Activator.CreateInstance(Type.GetType(m_Level.GameStateClassName)) as hwmGameState;
        m_GameState.Initialize();
        m_GameMode = gameObject.AddComponent(Type.GetType(m_Level.GameModeClassName)) as hwmGameMode;

        yield return(StartCoroutine(HandleAfterBeginPlay_Co()));

        yield return(StartCoroutine(m_GameMode.StartPlay_Co()));
    }