private void InitStampItem(int stampId, Transform iTransform, Action onClick) { ChatStampListItem component = iTransform.GetComponent <ChatStampListItem>(); component.Init(stampId); component.onButton = onClick; }
private void OnClickUnlockStamp(int stampId) { int num = Array.IndexOf(currentFavorite, stampId); if (num >= 0) { if (num != selectFavoriteStampIndex) { int num2 = currentFavorite[selectFavoriteStampIndex]; currentFavorite[selectFavoriteStampIndex] = stampId; ChatStampListItem component = favoriteIcons[selectFavoriteStampIndex].GetComponent <ChatStampListItem>(); component.Init(stampId); component.GetComponent <UITweenCtrl>().Reset(); component.GetComponent <UITweenCtrl>().Play(true, null); currentFavorite[num] = num2; component = favoriteIcons[num].GetComponent <ChatStampListItem>(); component.Init(num2); component.GetComponent <UITweenCtrl>().Reset(); component.GetComponent <UITweenCtrl>().Play(true, null); } } else { currentFavorite[selectFavoriteStampIndex] = stampId; ChatStampListItem component2 = favoriteIcons[selectFavoriteStampIndex].GetComponent <ChatStampListItem>(); component2.Init(stampId); component2.GetComponent <UITweenCtrl>().Reset(); component2.GetComponent <UITweenCtrl>().Play(true, null); } SetBlocker(true); }
private void SetStampTextre(int id) { Transform ctrl = GetCtrl(UI.OBJ_STAMP); ChatStampListItem component = ctrl.GetComponent <ChatStampListItem>(); component.Init(id); }
private void InitStampItem(int index, Transform iTransform, bool isRecycle) { if (m_StampIdListCanPost != null) { int stampId = m_StampIdListCanPost[index]; ChatStampListItem item = iTransform.GetComponent <ChatStampListItem>(); item.Init(stampId); ChatStampListItem chatStampListItem = item; chatStampListItem.onButton = (Action)Delegate.Combine(chatStampListItem.onButton, (Action) delegate { DispatchEvent("SEND_STAMP", item.StampId); }); } }
private void InitStampItem(int index, Transform iTransform, bool isRecycle) { if (stampIdListCanUse != null) { int num = stampIdListCanUse[index]; ChatStampListItem item = iTransform.GetComponent <ChatStampListItem>(); item.Init(num); if (!isRecycle) { if (num == createRequest.stampId) { SetStampTextre(item.StampId); } ChatStampListItem chatStampListItem = item; chatStampListItem.onButton = (Action)Delegate.Combine(chatStampListItem.onButton, (Action) delegate { SelectStamp(item.StampId); }); } } }
private IEnumerator DoOpen() { if (!initialized) { LoadingQueue loadingQueue = new LoadingQueue(this); LoadObject lo_chat_stamp_listitem = loadingQueue.Load(RESOURCE_CATEGORY.UI, "ChatStampListItemFavorite", false); if (loadingQueue.IsLoading()) { yield return((object)loadingQueue.Wait()); } mChatStampPrefab = (lo_chat_stamp_listitem.loadedObject as GameObject); yesButton.onClick.Add(new EventDelegate(OnYes)); noButton.onClick.Add(new EventDelegate(OnNo)); initialized = true; favoriteIcons = new List <Transform>(); unlockIcons = new List <Transform>(); } selectedIcon = CreateStampItem(selectedIconRoot.get_transform()).GetComponent <ChatStampListItem>(); selectedIcon.SetActiveComponents(false); CreateFavoriteStampList(); InitFavoriteStampList(); CreateUnlockStampList(); InitUnlockStampList(); }