public void StartGame() { MainMenu.SetActive(false); HostMenu.SetActive(false); ConnectMenu.SetActive(false); SceneManager.LoadScene("__TEST__"); }
public HostsGuestRequestUC(HostMenu caller, BE.GuestRequest guestRequest, BE.Host host) { InitializeComponent(); Name.Content = guestRequest.PrivateName + " " + guestRequest.FamilyName; Duration.Content = string.Format("{0}.{2} - {1}.{3}", guestRequest.EntryDate.Day, guestRequest.ReleaseDate.Day, guestRequest.EntryDate.Month, guestRequest.ReleaseDate.Month); MailAddress.Content = guestRequest.MailAddress; gr = guestRequest; this.host = host; this.caller = caller; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Debug.Log("Instance already exists, destroying object!"); Destroy(this); } startButton.gameObject.SetActive(false); }
void Start() { Instance = this; MainMenu.SetActive(true); // for ( int i = 0; i < this.MainMenu.transform.childCount; i++ ) // this.MainMenu.transform.GetChild ( i ).gameObject.SetActive ( true ); HostMenu.SetActive(false); ConnectMenu.SetActive(false); DontDestroyOnLoad(gameObject); }
// FIXME: override the show function to indicate this host's IP Address public override void Show(Action <IMenu> stateChanged) { base.Show(stateChanged); // Setup cursors SceneManager.CursorMode = CursorLockMode.None; Singleton.Get <MenuManager>().CursorModeOnPause = CursorLockMode.None; // Show IP address ipAddress.text = HostMenu.GetIpAddress(); // Bind to update event Cleanup(); checkPlayerNumber = new Action <float>(CheckPlayerNumber); Singleton.Instance.OnUpdate += checkPlayerNumber; }
/// <summary> /// Displays the correct menu based on the item that was right-clicked. Works /// around the fact that a right click on a non-selected item doesn't automatically /// perform a select operation on that item before calling the menu. So what would /// happen is you'd get the context menu for the item, but the _selected_ item wouldn't /// match the menu. This is only a problem when there are different context menus /// for a single tree. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeHosts_MouseUp(object sender, MouseEventArgs e) { // Show menu only if the right mouse button is clicked. if (e.Button == MouseButtons.Right) { // Point where the mouse is clicked. Point p = new Point(e.X, e.Y); // Get the node that the user has clicked. TreeNode node = treeHosts.GetNodeAt(p); if (node != null) { // Save the node the user has clicked. rightClickedNode = node; // Find the appropriate ContextMenu depending on the selected node. switch (Convert.ToString(node.Tag)) { case "WebMenu": WebMenu.Show(treeHosts, p); break; case "HostMenu": if (node.Name == "Hosts") { mnuHostEdit.Enabled = false; mnuHostDelete.Enabled = false; mnuHostViewLog.Enabled = false; } else { mnuHostEdit.Enabled = true; mnuHostDelete.Enabled = true; mnuHostViewLog.Enabled = true; } HostMenu.Show(treeHosts, p); break; } } } }
public void BACK_BUTTON() { MainMenu.SetActive(true); HostMenu.SetActive(false); ConnectMenu.SetActive(false); Server s = FindObjectOfType <Server> (); if (s != null) { s.server.Stop(); Destroy(s.gameObject); } Client c = FindObjectOfType <Client> (); if (c != null) { c.socket.Close(); Destroy(c.gameObject); } }