Ejemplo n.º 1
0
        void Awake()
        {
            if (awakened)
            {
                return;
            }
            awakened = true;

            if (Game.main != this)
            {
                if (shouldReplacePreviousGame)
                {
                    GameObject.DestroyImmediate(Game.main.gameObject);
                }
                else
                {
                    if (Game.main != null)
                    {
                        GameObject.DestroyImmediate(this.gameObject);
                        return;
                    }
                }
            }

            Game.m = this;
            if (Application.isPlaying)
            {
                GameObject.DontDestroyOnLoad(this.gameObject);
            }

            // Event Queue
            events = new Queue <IGameEvent>();

            IsoSwitchesManager.getInstance().getIsoSwitches();

            // Event Managers Creation
            eventManagers = new List <EventManager> ();
        }