Ejemplo n.º 1
0
 // Use this for initialization
 public override void OnStartLocalPlayer()
 {
     // Find any other player objects and their position relative to this player
     LobbyPlayer[] players = FindObjectsOfType <LobbyPlayer>();
     if (players.Length > 1)
     {
         multiplePlayers = true;
         foreach (LobbyPlayer player in players)
         {
             if (player == this)
             {
                 continue;
             }
             if (player.transform.position.x >= transform.position.x)
             {
                 playerOnRight = true;
             }
             else
             {
                 playerOnRight = false;
             }
             otherPlayer            = player;
             player.otherPlayer     = this;
             player.multiplePlayers = true;
         }
         transform.position = new Vector3(-3, 0, 0);
     }
     else
     {
         transform.position = new Vector3(3, 0, 0);
     }
     if (isLocalPlayer)
     {
         lobbyMan    = FindObjectOfType <LobbyMan>();
         lobbyPlayer = GetComponent <NetworkLobbyPlayer>();
         networkMan  = FindObjectOfType <NetworkMan>();
         readyButton.gameObject.SetActive(true);
         notReadyButton.gameObject.SetActive(false);
         SetUpButton(readyButton.GetComponent <_2DContextButton>());
     }
     else
     {
         readyButton.enabled    = false;
         notReadyButton.enabled = false;
     }
 }
Ejemplo n.º 2
0
 public void CreateRoom()
 {
     nm = GameObject.Find("NetworkMan").GetComponent <NetworkMan>();
     nm.CreateClicked();
 }