public void Initialize(List <DeckModel> rivalDecks, PracticeManager deckCheckUtil) { this.mRivalDecks = rivalDecks; base.get_transform().set_localScale(Vector3.get_one()); List <UIPracticeBattleListChild> list = new List <UIPracticeBattleListChild>(); int num = 0; UIPracticeBattleListChild[] array = this.mUIPracticeBattleListChildren_PracticeTargetAll; for (int i = 0; i < array.Length; i++) { UIPracticeBattleListChild uIPracticeBattleListChild = array[i]; uIPracticeBattleListChild.alpha = 0f; uIPracticeBattleListChild.get_transform().set_localPosition(Vector3.get_zero()); uIPracticeBattleListChild.get_transform().set_parent(this.mTransform_ObjectPool); uIPracticeBattleListChild.SetActive(false); uIPracticeBattleListChild.SetOnClickListener(null); bool flag = num < this.mRivalDecks.get_Count(); if (flag) { DeckModel deckModel = this.mRivalDecks.get_Item(num); List <IsGoCondition> conditions = deckCheckUtil.IsValidPractice(deckModel.Id); uIPracticeBattleListChild.Initialize(deckModel, conditions); uIPracticeBattleListChild.SetOnClickListener(new Action <UIPracticeBattleListChild>(this.OnClickChild)); uIPracticeBattleListChild.alpha = 1f; uIPracticeBattleListChild.get_transform().set_parent(this.mGrid_Focasable.get_transform()); uIPracticeBattleListChild.get_transform().set_localPosition(Vector3.get_zero()); uIPracticeBattleListChild.get_transform().set_localScale(Vector3.get_one()); uIPracticeBattleListChild.SetActive(true); uIPracticeBattleListChild.ParentHasChanged(); list.Add(uIPracticeBattleListChild); } num++; } this.mUIPracticeBattleListChildren_Focasable = list.ToArray(); }
private void Awake() { this.mWidgetThis = base.GetComponent <UIWidget>(); this.mUIButtonManager = base.GetComponent <UIButtonManager>(); this.mUIButtonManager.IndexChangeAct = delegate { UIPracticeBattleListChild component = this.mUIButtonManager.nowForcusButton.get_transform().get_parent().GetComponent <UIPracticeBattleListChild>(); this.ChangeFocus(component, false); }; this.mWidgetThis.alpha = 0f; }
private void Awake() { mWidgetThis = GetComponent <UIWidget>(); mUIButtonManager = GetComponent <UIButtonManager>(); mUIButtonManager.IndexChangeAct = delegate { UIPracticeBattleListChild component = ((Component)mUIButtonManager.nowForcusButton.transform.parent).GetComponent <UIPracticeBattleListChild>(); ChangeFocus(component, needSe: false); }; mWidgetThis.alpha = 0f; }
private void ChangeFocus(UIPracticeBattleListChild child, bool needSe) { if (this.mFocus != null) { this.mFocus.RemoveHover(); } this.mFocus = child; if (this.mFocus != null) { this.mFocus.Hover(); if (needSe) { SoundUtils.PlaySE(SEFIleInfos.CommonCursolMove); } } }
private void OnClickChild(UIPracticeBattleListChild child) { SoundUtils.PlaySE(SEFIleInfos.CommonEnter1); this.ChangeFocus(child, true); this.OnDeckSelectedDeck(child.GetDeckModel(), child.GetConditions()); }