public void SetTeam(Char_AttributeScript.Teams newTeam){ currentTeam = newTeam; if (currentTeam == Char_AttributeScript.Teams.BLUE) InitBlue(); else if (currentTeam == Char_AttributeScript.Teams.RED) InitRed(); }
public void SetTeam(Char_AttributeScript.Teams newTeam){ gui = GameObject.Find("GUI Controller").GetComponent<Level_GUIController>(); currentTeam = newTeam; redBeam.Stop(); blueBeam.Stop(); if (currentTeam == Char_AttributeScript.Teams.BLUE) InitBlue(); else if (currentTeam == Char_AttributeScript.Teams.RED) InitRed(); gui.SetUpLinkButtons(); //Invoke("KillSelf",lifeTime); }
void JoinTeam(string playerName, Char_AttributeScript.Teams teamToJoin) { bool alreadyInTeam = false; NetworkController = GameObject.Find("Network Controller").GetComponent<Menu_NetworkController>(); Debug.Log (teamToJoin); if (teamToJoin == Char_AttributeScript.Teams.RED){ for (int i = 0; i < NetworkController.blueTeam.Count; i++){ if (NetworkController.blueTeam[i].playerName.Equals(playerName)){ NetworkController.blueTeam.RemoveAt(i); break; } } for (int i = 0; i < NetworkController.redTeam.Count; i++){ if (NetworkController.redTeam[i].playerName.Equals(playerName)){ alreadyInTeam = true; break; } } if (!alreadyInTeam) NetworkController.redTeam.Add(new LobbyPlayer(false,playerName,teamToJoin)); } else { for (int i = 0; i < NetworkController.redTeam.Count; i++){ if (NetworkController.redTeam[i].playerName.Equals(playerName)){ NetworkController.redTeam.RemoveAt(i); break; } } for (int i = 0; i < NetworkController.blueTeam.Count; i++){ if (NetworkController.blueTeam[i].playerName.Equals(playerName)){ alreadyInTeam = true; break; } } if (!alreadyInTeam) NetworkController.blueTeam.Add(new LobbyPlayer(false,playerName,teamToJoin)); } GUIController = GameObject.Find("GUI Controller").GetComponent<Menu_GUIController>(); GUIController.LobbyRedrawTeams(); }
public void SetTeam(Char_AttributeScript.Teams newTeam){ currentTeam = newTeam; if (currentTeam == Char_AttributeScript.Teams.BLUE) InitBlue(); else if (currentTeam == Char_AttributeScript.Teams.RED) InitRed(); //Invoke("KillSelf",lifeTime); }
void LinkSpawn(Vector3 spawnLoc, Char_AttributeScript.Teams team){ Debug.Log("Button Clicked "+ team.ToString()); Char_SelectChar.currentTeam = team; Char_SelectChar.spawnLocation = spawnLoc; switch (GUIClass){ case classes.SOLDIER: Char_SelectChar.classNo = 0; break; case classes.THIEF: Char_SelectChar.classNo = 1; break; case classes.BUILDER: Char_SelectChar.classNo = 2; break; default: break; } }
// Used to set the weapon icons public void SetWeaponIcon(Char_AttributeScript.Class player_class, int weapon_slot) { // Set all weapons to false pistol.gameObject.SetActive (false); shotgun.gameObject.SetActive (false); sniper.gameObject.SetActive (false); rocketLauncher.gameObject.SetActive (false); glove.gameObject.SetActive (false); // Activate the desired weapon switch (weapon_slot) { // PRIMARY case 1: pistol.gameObject.SetActive(true); break; // SECONDARY case 2: if (player_class == Char_AttributeScript.Class.SOLDIER) { rocketLauncher.gameObject.SetActive(true); } else if (player_class == Char_AttributeScript.Class.THIEF) { sniper.gameObject.SetActive(true); } else if (player_class == Char_AttributeScript.Class.BUILDER) { shotgun.gameObject.SetActive(true); } break; // TERTIARY case 3: if (player_class == Char_AttributeScript.Class.BUILDER) { glove.gameObject.SetActive(true); } break; } }
public LobbyPlayer(bool r, string s, Char_AttributeScript.Teams t){ ready = r; playerName = s; team = t; }