public void Initialize(Dictionary <DeckPracticeType, bool> selectableDeckPracticeTypes) { base.get_transform().set_localScale(Vector3.get_one()); this.mGridFocasable.cellHeight = 0f; this.mUIPracticeDeckTypeSelectChildrenFocusable = null; this.mFocus = null; List <UIPracticeDeckTypeSelectChild> list = new List <UIPracticeDeckTypeSelectChild>(); UIPracticeDeckTypeSelectChild[] array = this.mUIPracticeDeckTypeSelectChildrenAll; for (int i = 0; i < array.Length; i++) { UIPracticeDeckTypeSelectChild uIPracticeDeckTypeSelectChild = array[i]; uIPracticeDeckTypeSelectChild.get_gameObject().SetActive(false); uIPracticeDeckTypeSelectChild.get_transform().set_localPosition(Vector3.get_zero()); uIPracticeDeckTypeSelectChild.SetOnClickListener(null); DeckPracticeType deckPracticeType = uIPracticeDeckTypeSelectChild.GetDeckPracticeType(); bool flag = selectableDeckPracticeTypes.ContainsKey(deckPracticeType); if (flag) { list.Add(uIPracticeDeckTypeSelectChild); uIPracticeDeckTypeSelectChild.get_gameObject().SetActive(true); uIPracticeDeckTypeSelectChild.get_transform().set_parent(this.mGridFocasable.get_transform()); uIPracticeDeckTypeSelectChild.get_transform().set_localPosition(Vector3.get_zero()); uIPracticeDeckTypeSelectChild.get_transform().set_localScale(Vector3.get_one()); uIPracticeDeckTypeSelectChild.ParentHasChanged(); uIPracticeDeckTypeSelectChild.SetOnClickListener(new Action <UIPracticeDeckTypeSelectChild>(this.OnDeckTypeSelect)); } else { uIPracticeDeckTypeSelectChild.get_transform().set_parent(this.mTransform_ObjectPools); } } this.mUIPracticeDeckTypeSelectChildrenFocusable = list.ToArray(); }
public void OnDeckTypeSelect(UIPracticeDeckTypeSelectChild selectedView) { ChangeFocus(selectedView); OnSelectedDeckPracticeType(mFocus.GetDeckPracticeType()); }