public void Register(PlayerName player_name) { if (player_name.gameObject == Game.Instance.GetPlayerAvatar()) { return; } var widget = GameObject.Instantiate(m_name_widget_prefab); widget.GetComponent <RectTransform>().SetParent(m_name_widget_prefab.transform.parent); widget.transform.localPosition = new Vector3(0, m_name_height, 0); widget.transform.localRotation = Quaternion.identity; widget.transform.localScale = Vector3.one; widget.m_owner = player_name.GetComponent <Photon.Pun.PhotonView>().Owner; widget.m_text.text = widget.m_owner.NickName; widget.gameObject.SetActive(true); m_player_names[player_name] = widget; }
public void DrawUI() { PlayerName.GetComponent <Text>().text = Player.Name; PlayerState.transform.GetChild(0).GetChild(0).GetComponent <Text>().text = Player.NowHP.ToString(); PlayerState.transform.GetChild(0).GetChild(1).GetComponent <Text>().text = "/ " + Player.MaxHP.ToString(); EnemyInfo.transform.GetChild(0).GetChild(0).GetComponent <Text>().text = Boss.Name; EnemyInfo.transform.GetChild(1).GetChild(0).GetComponent <Text>().text = StageManager.Get().GetNow().type_str; EnemyState.transform.GetChild(0).GetChild(0).GetComponent <Text>().text = Boss.NowHP.ToString(); EnemyState.transform.GetChild(0).GetChild(1).GetComponent <Text>().text = "/ " + Boss.MaxHP.ToString(); if (IsGameOver) { gameOverWin.SetActive(true); } else { gameOverWin.SetActive(false); } }