Beispiel #1
0
    public void StartGame()
    {
        MainMenu.SetActive(false);

        HostMenu.SetActive(false);

        ConnectMenu.SetActive(false);

        SceneManager.LoadScene("__TEST__");
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     cm              = GetComponent <ConnectMenu>();
     isPaused        = true;
     resolutions     = Screen.resolutions;
     resolutionIndex = (resolutions.Length - 1) / 2;
     QualityNames    = QualitySettings.names;
     playerList      = true;
     enableHelper    = GameObject.FindWithTag("EnableHelper").gameObject;
 }
Beispiel #3
0
	void Start ()
	{
		System.Random rand = new System.Random();
		NameInputField.GetComponent<InputField>().text = "Player_" + rand.Next(9999);
		Instance = this;

		MainMenu.SetActive ( true );

//		for ( int i = 0; i < this.MainMenu.transform.childCount; i++ )
//			this.MainMenu.transform.GetChild ( i ).gameObject.SetActive ( true );

		ConnectMenu.SetActive ( false );
		
		DontDestroyOnLoad ( gameObject );
	}
Beispiel #4
0
    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);
    }
Beispiel #5
0
	public void BACK_BUTTON ()
	{
		MainMenu.SetActive ( true );

		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 );
		}
	}