Exemplo n.º 1
0
        bool CheckIfCopy()
        {
            string myName = gameObject.name;

            if (!menuInstances.ContainsKey(myName))
            {
                menuInstances[myName] = this;
                DontDestroyOnLoad(gameObject);


                if (isMainMenu)
                {
                    if (mainMenu != null)
                    {
                        Debug.LogWarning("More than one main menu specified, using: " + mainMenu.gameObject.name + ", leaving out: " + myName);
                    }
                    else
                    {
                        mainMenu = this;
                    }
                }
                return(false);
            }
            if (menuInstances[myName] == this)
            {
                return(false);
            }
            // Debug.LogWarning("Deleting Copy of Menu: " + myName);
            Destroy(gameObject);
            return(true);
        }
Exemplo n.º 2
0
        public static void CloseMenu(string name)
        {
            ManualMenu m = GetMenu(name);

            if (m != null)
            {
                m.CloseMenu();
            }
        }
Exemplo n.º 3
0
        public static void OpenMenu(string name, Actor[] actorContexts)
        {
            ManualMenu m = GetMenu(name);

            if (m != null)
            {
                m.OpenMenu(actorContexts);
            }
        }