private void setName(int id) { GameObject KillsInc = GameObject.FindGameObjectWithTag("Kills"); KillsIncrementer ki = KillsInc.GetComponent <KillsIncrementer>(); if (PhotonView.isMine) { switch (id % 5) { case 1: ki.eachPlayerName[0] = PhotonNetwork.playerList[0].ID + " " + PhotonNetwork.playerList[0].NickName; break; case 2: ki.eachPlayerName[1] = PhotonNetwork.playerList[1].ID + " " + PhotonNetwork.playerList[1].NickName; break; case 3: ki.eachPlayerName[2] = PhotonNetwork.playerList[2].ID + " " + PhotonNetwork.playerList[2].NickName; break; case 4: ki.eachPlayerName[3] = PhotonNetwork.playerList[3].ID + " " + PhotonNetwork.playerList[3].NickName; break; case 0: ki.eachPlayerName[4] = PhotonNetwork.playerList[4].ID + " " + PhotonNetwork.playerList[4].NickName; break; default: break; } } }
private void healthSet() { GameObject KillsInc = GameObject.FindGameObjectWithTag("Kills"); KillsIncrementer ki = KillsInc.GetComponent <KillsIncrementer>(); if (GetComponent <PhotonView>().ownerId == 1) { ki.eachPlayerHealth[0] = curr_health; } if (GetComponent <PhotonView>().ownerId == 2) { ki.eachPlayerHealth[1] = curr_health; } if (GetComponent <PhotonView>().ownerId == 3) { ki.eachPlayerHealth[2] = curr_health; } if (GetComponent <PhotonView>().ownerId == 4) { ki.eachPlayerHealth[3] = curr_health; } if (GetComponent <PhotonView>().ownerId == 5) { ki.eachPlayerHealth[4] = curr_health; } }
private void setDeaths() { GameObject go = GameObject.FindGameObjectWithTag("Kills"); KillsIncrementer k = go.GetComponent <KillsIncrementer>(); GameUI.Instance.playerDeaths.text = k.eachPlayerDeaths[(PhotonNetwork.player.ID - 1) % 5].ToString(); }
private void setDeaths(int id) { GameObject KillsInc = GameObject.FindGameObjectWithTag("Kills"); KillsIncrementer ki = KillsInc.GetComponent <KillsIncrementer>(); switch (id % 5) { case 1: ki.eachPlayerDeaths[0]++; break; case 2: ki.eachPlayerDeaths[1]++; break; case 3: ki.eachPlayerDeaths[2]++; break; case 4: ki.eachPlayerDeaths[3]++; break; case 0: ki.eachPlayerDeaths[4]++; break; default: break; } }
private void Awake() { globalKillInc = GameObject.FindGameObjectWithTag("Kills"); globalKi = globalKillInc.GetComponent <KillsIncrementer>(); Instance = this; PhotonView = GetComponent <PhotonView>(); curr_health = max_health = 100; _playerHealth = GetComponentInChildren <Text>(); c = cam.GetComponent <Camera>(); health = 10; target = GameObject.FindGameObjectWithTag("target"); }
// Use this for initialization void Start() { rankScore = new int[PhotonNetwork.countOfPlayers]; rS = new int[PhotonNetwork.countOfPlayers]; s = new string[PhotonNetwork.countOfPlayers]; fs = new string[PhotonNetwork.countOfPlayers]; d = new int[PhotonNetwork.countOfPlayers]; t = new string[PhotonNetwork.countOfPlayers]; KI = GameObject.FindGameObjectWithTag("Kills"); KII = KI.GetComponent <KillsIncrementer>(); for (int i = 0; i < PhotonNetwork.countOfPlayers; i++) { fs[i] = "0"; } pv = GetComponent <PhotonView>(); }
private void increaseKills(int playerUID) { GameObject KillsInc = GameObject.FindGameObjectWithTag("Kills"); KillsIncrementer ki = KillsInc.GetComponent <KillsIncrementer>(); switch (playerUID % 5) { case 1: ki.eachPlayerKills[0]++; ki.eachPlayerScore[0] = ki.eachPlayerScore[0] + 25; break; case 2: ki.eachPlayerKills[1]++; ki.eachPlayerScore[1] = ki.eachPlayerScore[1] + 25; break; case 3: ki.eachPlayerKills[2]++; ki.eachPlayerScore[2] = ki.eachPlayerScore[2] + 25; break; case 4: ki.eachPlayerKills[3]++; ki.eachPlayerScore[3] = ki.eachPlayerScore[3] + 25; break; case 0: ki.eachPlayerKills[4]++; ki.eachPlayerScore[4] = ki.eachPlayerScore[4] + 25; break; default: break; } }
private void Start() { KII = KI.GetComponent <KillsIncrementer>(); pv.RPC("playerDetails", PhotonTargets.All); // RoomListingButtons.Add(roomListing); }