public void Awake(GameObject parent, GamerInfo info, int posIndex) { res = ETModel.Game.Scene.GetComponent <ResourcesComponent>(); res.LoadBundle(UICowCowAB.CowCow_Texture); res.LoadBundle(UICowCowAB.CowCow_SoundOther); microphone = Game.Scene.GetComponent <MicrophoneComponent>(); this.Status = (UIGamerStatus)info.Status; this.gamerName = info.Name; UIGameInfo = GamerFactory.Create(UICowCowType.CowCowGamerInfo); UIGameInfo.transform.SetParent(parent.transform, false); UIGameInfo.name = UICowCowType.CowCowGamerInfo; ReferenceCollector rc = UIGameInfo.GetComponent <ReferenceCollector>(); Image headIcon = rc.Get <GameObject>("HeadIcon").GetComponent <Image>(); headIcon.transform.localPosition = GamerData.Pos[posIndex].HeadPos; Text gamerNames = rc.Get <GameObject>("Names").GetComponent <Text>(); coin = rc.Get <GameObject>("Coin").GetComponent <Text>(); status = rc.Get <GameObject>("Status").GetComponent <Text>(); cowType = rc.Get <GameObject>("CowType").GetComponent <Text>(); HandCard = rc.Get <GameObject>("HandCard").GetComponent <CanvasGroup>(); HandCard.transform.localPosition = GamerData.Pos[posIndex].CardPos; for (int i = 0; i < cards.Length; i++) { cards[i] = rc.Get <GameObject>("Card" + i).GetComponent <Image>(); } promptBtn = rc.Get <GameObject>("PromptBtn").GetComponent <Button>(); submitBtn = rc.Get <GameObject>("SubmitBtn").GetComponent <Button>(); emoji = rc.Get <GameObject>("Emoji").GetComponent <Image>(); chatBG = rc.Get <GameObject>("ChatBG").GetComponent <CanvasGroup>(); chatText = rc.Get <GameObject>("ChatText").GetComponent <Text>(); bankerIcon = rc.Get <GameObject>("BankerIcon").GetComponent <Image>(); chatBG.transform.localPosition = GamerData.Pos[posIndex].ChatPosData.Pos; chatBG.transform.Rotate(GamerData.Pos[posIndex].ChatPosData.Rotate); chatText.transform.Rotate(GamerData.Pos[posIndex].ChatPosData.Rotate); promptBtn.onClick.Add(OnPrompt); submitBtn.onClick.Add(OnSubmit); gamerNames.text = info.Name; this.SetCoin(info.Coin.ToString()); this.Sex = info.Sex; //headIcon.sprite = info.HeadIcon; }
/// <summary> /// 显示状态 /// </summary> public void SetStatus(UIGamerStatus uiStatus, string status = null) { this.status.text = status; this.Status = uiStatus; }