private void Start() { int num = chatItem.Length; if (num > chatSayTexts.Length) { num = chatSayTexts.Length; } for (int i = 0; i < num; i++) { UIChatItem uIChatItem = chatItem[i]; uIChatItem.SetChatData(this, chatSayTexts[i], i); } }
private void Awake() { mUIGameModel = UIModelMgr.Instance.GetModel <UIGameModel>(); mCacheTransform = this.transform; mNoneIcon = mCacheTransform.FindComponent <UISprite>("None"); mPlayerWidget = mCacheTransform.FindComponent <UIWidget>("InfoGroup"); mOffLineSprite = mCacheTransform.FindComponent <UISprite>("InfoGroup/HeadIcon/OffLine"); mZhuangIcon = mCacheTransform.FindComponent <UISprite>("InfoGroup/HeadIcon/IconZhuang"); mOwnerIcon = mCacheTransform.FindComponent <UISprite>("InfoGroup/HeadIcon/IconOwner"); mHeadIcon = mCacheTransform.FindComponent <UITexture>("InfoGroup/HeadIcon"); mUIChatItem = mCacheTransform.FindComponent <UIChatItem>("InfoGroup/UIChatItem"); mBtnReady = mCacheTransform.FindComponent <UIButton>("InfoGroup/StateGroup/BtnReady"); mReadyState = mCacheTransform.FindComponent <Transform>("InfoGroup/StateGroup/ReadyState"); mName = mCacheTransform.FindComponent <UILabel>("InfoGroup/Name"); mScore = mCacheTransform.FindComponent <UILabel>("InfoGroup/Score"); mUIExpressionItem = mCacheTransform.Find("InfoGroup/UIExpressionItem").gameObject; UIEventListener.Get(mBtnReady.gameObject).onClick += OnReadyClick; mCacheTransform.GetUIEventListener("InfoGroup/HeadIcon").onClick += OnUserInfoClick; }