Exemplo n.º 1
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //	Awake() is being used for error checking of incorrectly attatched components in the inspector (BEGIN)
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    void Awake()
    {
        Singleton_Main_Menu_Functionality = this;

        if (quit_menu_obj == null)              //Checks to see if quit_menu_obj was correctly attached in the inspector
        {
            Debug.LogError("The gameobject for 'quit_menu_obj' was not assigned before the game was started.");
            /* This would be for assigning the game object to the inspector in case it wasn't assigned correctly during edit mode */

            /*
             * Currently this does not work, because the object starts out as inactive.
             * If you want to use the next line of code, then...
             * You will need to set it to active in the inspector,
             * this code will assign it correctly in awake,
             * and then turn it off in start once the connection has been made.
             */
            //quit_menu_obj = GameObject.Find("Quit_Menu");
            //GameObject.Find ("Play_Menu_Functionality");
        }
    }
Exemplo n.º 2
0
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //	Awake() is being used for error checking of incorrectly attatched components in the inspector (BEGIN)
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 void Awake()
 {
     Singleton_Main_Menu_Functionality = this;
 }