Exemplo n.º 1
0
 protected virtual void Start()
 {
     gm = GMS.instance;
     gm.SetManager(this);
     _menuDict = new Dictionary <string, MenuObjectMap>();
     foreach (MenuObjectMap mom in menuObjects)
     {
         _menuDict[mom.name] = mom;
         ShowMenu(mom.active, mom.name);
     }
     currentCamera = Camera.main;
 }
Exemplo n.º 2
0
        protected virtual void Awake()
        {
            GameManager g = GameObject.FindObjectOfType <GameManager>();

            if (g != this) //already a game manager here. destroy ourselves.
            {
                GameObject.Destroy(this.gameObject);
            }
            else //we are the first
            {
                gm = GameObject.FindObjectOfType <GMS>();
                if (gm == null)
                {
                    Instantiate(gameManagerSingletonPrefab);
                    gm = GMS.instance;
                }
                DontDestroyOnLoad(this);
            }
        }