public void SetPlayerInfo(GameObject go, PlayerData pd, int hostId) { NetTexture icon = go.transform.Find("Portrait/IconB").GetComponent <NetTexture> (); GameObject delete = go.transform.Find("delete").gameObject; UILabel name = go.transform.Find("name").GetComponent <UILabel> (); if (pd == null) { icon.gameObject.SetActive(false); delete.gameObject.SetActive(false); name.gameObject.SetActive(false); } else { icon.picUrl = pd.icon; icon.gameObject.SetActive(true); bool canDelete = LocalPlayer.Get().playerData.userId == hostId && pd.userId != hostId; delete.SetActive(canDelete); if (pd.userId == hostId) { name.text = LanguageDataProvider.Format(908, pd.name); } else { name.text = pd.name; } name.gameObject.SetActive(true); } }
private void SetSelfInfo(GameObject go) { go.SetActive(true); NetTexture icon = go.transform.Find("IconB").GetComponent <NetTexture>(); UILabel name = go.transform.Find("Label").GetComponent <UILabel>(); UILabel score = go.transform.Find("Score/Score").GetComponent <UILabel>(); { icon.picUrl = LocalPlayer.Get().playerData.icon; name.text = LocalPlayer.Get().playerData.name; score.text = LocalPlayer.Get().playerData.score.ToString(); } }
private void SetPosInfo(int pos, PlayerData data) { GameObject root = GetPosRoot(); GameObject info = root.transform.Find("pos" + (pos + 1)).Find("info").gameObject; if (data == null) { info.transform.Find("full").gameObject.SetActive(false); info.transform.Find("empty").gameObject.SetActive(true); return; } Team t = BattleSystem.Instance.sceneManager.teamManager.GetTeam((TEAM)(pos + 1)); Color color = t.color; color.a = 1.0f; info.transform.Find("full").gameObject.SetActive(true); info.transform.Find("empty").gameObject.SetActive(false); UILabel score = info.transform.Find("full/score/num").GetComponent <UILabel> (); //UISprite kuang = info.transform.FindChild ("full/icon").GetComponent<UISprite> (); NetTexture icon = info.transform.Find("full/usericon").GetComponent <NetTexture> (); UILabel name = info.transform.Find("full/name").GetComponent <UILabel> (); //UILabel unionName = info.transform.FindChild ("full/union/name").GetComponent<UILabel> (); score.text = data.score.ToString(); icon.picUrl = data.icon; icon.picColor = color; //kuang.color = color; name.text = data.name; name.color = color; //unionName.text = data.unionName; Animator ani = info.GetComponent <Animator> (); if (data.userId == LocalPlayer.Get().playerData.userId) { ani.Play("WaitWindow_information1_mine"); } else { ani.Play("WaitWindow_information1_other"); } }
private void SetPlayerInfo(GameObject go, PlayerData pd) { go.SetActive(true); NetTexture icon = go.transform.Find("IconB").GetComponent <NetTexture>(); UILabel name = go.transform.Find("Label").GetComponent <UILabel>(); UILabel score = go.transform.Find("Score/Score").GetComponent <UILabel>(); if (pd == null) { icon.gameObject.SetActive(false); name.gameObject.SetActive(false); score.gameObject.SetActive(false); return; } { icon.picUrl = pd.icon; name.text = pd.name; score.text = pd.score.ToString(); } }
private void SetPlayerInfo(GameObject go, PlayerData pd) { go.SetActive(true); NetTexture icon = go.transform.Find("Portrait/IconB").GetComponent <NetTexture>(); UILabel name = go.transform.Find("name").GetComponent <UILabel>(); UILabel score = go.transform.Find("score/score").GetComponent <UILabel>(); GameObject matching = go.transform.Find("Matching").gameObject; GameObject pic = go.transform.Find("score/pic").gameObject; if (pd == null) { pic.SetActive(false); matching.SetActive(true); icon.gameObject.SetActive(false); name.gameObject.SetActive(false); score.gameObject.SetActive(false); } else { pic.SetActive(true); matching.SetActive(false); icon.gameObject.SetActive(true); name.gameObject.SetActive(true); score.gameObject.SetActive(true); icon.picUrl = pd.icon; if (pd.userId == -1) { name.text = LanguageDataProvider.Format(908, pd.name); } else { name.text = pd.name; } score.text = pd.score.ToString(); } }