Пример #1
0
 public static MenuInteraction GetInstance()
 {
     if (_instance == null)
     {
         _instance = GameObject.FindObjectOfType <MenuInteraction>();
     }
     return(_instance);
 }
Пример #2
0
 public void removeChildren(MenuInteraction m)
 {
     foreach (TreeNode c in children)
     {
         c.removeChildren(m);
         m.removeMenuOption(c.node);
     }
     children.Clear();
 }
Пример #3
0
 /// <summary>
 /// Check if the setting has be changed and call the confirmation panel if it was now saved.
 /// </summary>
 /// <param name="panelIndex"></param>
 public void ExitSettings(int panelIndex)
 {
     if (!_applyButton.interactable)
     {
         MenuInteraction.GetInstance().PanelToggle(panelIndex);
     }
     else
     {
         MenuInteraction.GetInstance().PanelToggle(_confirmationPanelIndex);
     }
 }
Пример #4
0
    private void Start()
    {
        menuInteraction = PlayerMenus.GetElementWithName(menuName, interactionElementName) as MenuInteraction;

        button = GetComponent <UnityEngine.UI.Button>();

        Color highlightedColor = button.colors.highlightedColor;

        normalColorBlock = highlightedColorBlock = button.colors;
        highlightedColorBlock.normalColor = highlightedColor;
    }
Пример #5
0
    void Awake()
    {
        menuInteraction = GameObject.Find("MenuManager").GetComponent <MenuInteraction>();

        thisImage               = GetComponent <Image>();
        thisButton              = GetComponent <Button>();
        thisImage.enabled       = false;
        thisButton.interactable = false;

        nameText.text        = "";
        playerCountText.text = "";
    }
    // Start is called before the first frame update
    void Start()
    {
        menuInteraction = GameObject.Find("StartManager").GetComponent <MenuInteraction>();
        if (menuInteraction.colorChoose == 1)
        {
            cameraAnimator.SetTrigger(WhitesPlay);
        }

        if (menuInteraction.colorChoose == 2)
        {
            cameraAnimator.SetTrigger(BlacksPlay);
        }
    }
Пример #7
0
 /// <summary>
 /// Toggle the MainMenu, Pause the game and Unpause accordingly.
 /// </summary>
 public void ToggleMainMenu()
 {
     if (Time.timeScale == GameManager.GetInstance().CurrentGameSpeed)
     {
         PauseGame();
         MenuInteraction.GetInstance().PanelToggle(0);
     }
     else
     {
         UnPauseGame();
         MenuInteraction.GetInstance().PanelToggle();
     }
 }
Пример #8
0
        static void Main(string[] args)
        {
            var coffeOptions = new List <Option>
            {
                new Option {
                    Id = 1, Value = "Neagra"
                },
                new Option {
                    Id = 2, Value = "Espresso"
                },
                new Option {
                    Id = 3, Value = "Ice coffe"
                },
                new Option {
                    Id = 4, Value = "Latte"
                },
            };

            var coffeMenu      = new MenuInteraction(SelectionType.SingleSelection, coffeOptions);
            var coffeSelection = coffeMenu.GetSelection();

            var extraOptions = new List <Option>
            {
                new Option {
                    Id = 1, Value = "Lapte"
                },
                new Option {
                    Id = 2, Value = "Indulcitor artificial"
                },
                new Option {
                    Id = 3, Value = "Servetel"
                },
                new Option {
                    Id = 4, Value = "Lingurita"
                },
                new Option {
                    Id = 5, Value = "Zahar brun"
                },
                new Option {
                    Id = 6, Value = "Zahar alb"
                },
            };
            var extraMenu      = new MenuInteraction(SelectionType.MultipleSelection, extraOptions);
            var extraSelection = extraMenu.GetSelection();
        }
Пример #9
0
    void Awake()
    {
        DontDestroyOnLoad(this);

        menuManager     = GameObject.Find("MenuManager").GetComponent <MenuManager>();
        menuInteraction = GameObject.Find("MenuManager").GetComponent <MenuInteraction>();

        serverInfo = new ServerInfo[numServers];
        for (int i = 0; i < numServers; ++i)
        {
            serverInfo[i] = GameObject.Find("ServerInfo " + (i + 1).ToString()).GetComponent <ServerInfo>();
        }

        lobbyInfo = new PlayerLobbyInfo[maxPlayers];
        for (int i = 0; i < maxPlayers; ++i)
        {
            lobbyInfo[i] = GameObject.Find("PlayerInfo" + (i + 1).ToString()).GetComponent <PlayerLobbyInfo>();
        }
    }
Пример #10
0
 // Use this for initialization
 void Start()
 {
     applyButton = GameObject.Find("ApplyButton").GetComponent <Button>();
     menuCode    = GameObject.FindObjectOfType <MenuInteraction>();
 }