Ejemplo n.º 1
0
        /// <summary>
        /// Awake (Unity) function
        /// This is called FIRST, you may have to increase priority to load this in the Script
        /// Execution Order (already done in template project). Below are goals of this function:
        /// * Verify attached files to game Manager for referencing other managers
        ///   other sort of information from outside the particular script you are in.
        /// * Identify and store the current device / OS that the game is running on and store it.
        /// * Update Scene To Load Next, This is used for development to quickly change the first scene when you hit play.
        /// * If this is not Unity Editor make sure levelEditMode is false, to avoid problems where wrong states are called (like input processing sent to levelEditor)
        /// </summary>
        protected override void Awake()
        {
            Debug.Log("GM_Awake()");
            gameManager = GetComponent <GM>() as GM;

            //if (useAtlas) setAtlas();
            if (scene == null)
            {
                scene = GameObject.FindGameObjectWithTag("_SM").GetComponent <sceneManager>();
            }

            #if UNITY_EDITOR
            if (scene.thisScene != currentScene)
            {
                currentScene = scene.thisScene;
            }
            if (scene.debugOn)
            {
                framework.gMode = (int)GameMode.Main;
            }
            #else
            //levelMan.levelEditMode = false;
            #endif
            DontDestroyOnLoad(this.gameObject);
            base.Awake(); // Call Parent Awake
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Awake (Unity) function
        /// This is called FIRST, you may have to increase priority to load this in the Script 
        /// Execution Order (already done in template project). Below are goals of this function:
        /// * Verify attached files to game Manager for referencing other managers
        ///   other sort of information from outside the particular script you are in.
        /// * Identify and store the current device / OS that the game is running on and store it.
        /// * Update Scene To Load Next, This is used for development to quickly change the first scene when you hit play.
        /// * If this is not Unity Editor make sure levelEditMode is false, to avoid problems where wrong states are called (like input processing sent to levelEditor)
        /// </summary>
        protected override void Awake()
        {
            Debug.Log("GM_Awake()");
            gameManager = GetComponent<GM>() as GM;

            //if (useAtlas) setAtlas();
            if (scene == null) scene = GameObject.FindGameObjectWithTag("_SM").GetComponent<sceneManager>();

            #if UNITY_EDITOR
            if (scene.thisScene != currentScene)
            {
                currentScene = scene.thisScene;
            }
            if (scene.debugOn)
            {
                framework.gMode = (int)GameMode.Slots;
            }
            #else
			//levelMan.levelEditMode = false;
            #endif
            DontDestroyOnLoad(this.gameObject);
            base.Awake(); // Call Parent Awake
        }