Beispiel #1
0
    //--------------------------------------------------------------------------------



    //-----------------------------------------------------------------------------
    //---------- STATE SECTION -------------------------------
    // State functions for each state contains exactly one "Enter", "Exit" and "Update" function
    // The states are a good way to handle contained Create, Update and Destroy for parts that should only be active in specific game sections
    // Although practically, many of the functions currently is empty but is there for consistency and potential uses in later version.

    //---- PLAYER PICK MENU STATE ----------------
    public void State_PlayerPickMenu_EnterState()
    {
        if (m_UI_Main == null)
        {
            GameObject obj = Instantiate(Prefab_UI_Main, Vector2.zero, Quaternion.identity);
            m_UI_Main = obj.GetComponent <UI_Main>();
        }
        m_UI_Main.Init(numberOfPlayersActive);
        SetNumberOfPlayers(numberOfPlayersActive);
        ResetPlayerScores();
        ObjectManager.GetObjectManager().Ship_SynchToPlayerNum(numberOfPlayersActive);
    }