void CmdSpawn(int i, Vector3 position, Base_NW.Team thisTeam, Color thisColor) { var go = Instantiate(tanks[i], position, Quaternion.identity); go.GetComponent <Base_NW>().team = thisTeam; go.GetComponent <Base_NW>().teamColor = thisColor; NetworkServer.SpawnWithClientAuthority(go, connectionToClient); }
public void CmdSpawnBase(Vector3 position, Base_NW.Team thisTeam, Color thisColor) { var go = (GameObject)Instantiate(myBase, position, Quaternion.identity); if (thisTeam == Base_NW.Team.Player2) { go.transform.Rotate(Vector3.up, 180); } if (thisTeam == Base_NW.Team.Player1) { go.transform.Rotate(Vector3.up, -50); } go.GetComponent <Base_NW>().team = thisTeam; go.GetComponent <Base_NW>().teamColor = thisColor; NetworkServer.SpawnWithClientAuthority(go, connectionToClient); }
void Start() { if (myColor != Color.black) { if (myColor == Color.blue) { myTeam = Base_NW.Team.Player1; } else { myTeam = Base_NW.Team.Player2; } } if (isLocalPlayer) { StartCoroutine(InitializeBase()); } }
public void CmdDestroyNW(Base_NW.Team winner) { Destroy(gameObject); }