//查看玩家幸存状态 public void GameCheck() { if (ShowPlayer.activeSelf) { ShowPlayer.SetActive(false); } else { ShowPlayer.SetActive(true); string tmp; int i; GameObject.Find("ShowPlayer/ID").GetComponent <Text> ().text = ""; GameObject.Find("ShowPlayer/Name").GetComponent <Text> ().text = ""; GameObject.Find("ShowPlayer/Role").GetComponent <Text> ().text = ""; GameObject.Find("ShowPlayer/Alive").GetComponent <Text> ().text = ""; GameObject.Find("ShowPlayer/Police").GetComponent <Text> ().text = ""; GameObject.Find("ShowPlayer/Lover").GetComponent <Text> ().text = ""; for (i = 0; i < PlayerNum; i++) { tmp = Player [i].GetComponent <PlayerCard> ().PlayerID.ToString() + "\n"; GameObject.Find("ShowPlayer/ID").GetComponent <Text> ().text += tmp; tmp = Player [i].GetComponent <PlayerCard> ().Name + "\n"; GameObject.Find("ShowPlayer/Name").GetComponent <Text> ().text += tmp; tmp = Player [i].GetComponent <PlayerCard> ().Role + "\n"; GameObject.Find("ShowPlayer/Role").GetComponent <Text> ().text += tmp; if (Player [i].GetComponent <PlayerCard> ().IsAlive) { GameObject.Find("ShowPlayer/Alive").GetComponent <Text> ().text += "存活\n"; } else { GameObject.Find("ShowPlayer/Alive").GetComponent <Text> ().text += "死亡\n"; } if (Player [i] == jingzhang) { GameObject.Find("ShowPlayer/Police").GetComponent <Text> ().text += "警长\n"; } else { GameObject.Find("ShowPlayer/Police").GetComponent <Text> ().text += "\n"; } if (Player [i] == Lovers [0] || Player [i] == Lovers [1]) { GameObject.Find("ShowPlayer/Lover").GetComponent <Text> ().text += "情侣\n"; } else { GameObject.Find("ShowPlayer/Lover").GetComponent <Text> ().text += "\n"; } } } }
// Use this for initialization void Start() { //初始化游戏界面 CanClick = true; ConfigUI.SetActive(false); PlayerUI.SetActive(false); ChoosePlayer.SetActive(false); ShowInfo.SetActive(false); ShowPlayer.SetActive(false); GameStage = "准备开始"; GameMode = "Player"; GameObject.Find("MainCanvas/NextStage").GetComponent <Button> ().interactable = false; }