Example #1
0
        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();
        }
Example #2
0
        public void Initialize(Dictionary <DeckPracticeType, bool> selectableDeckPracticeTypes)
        {
            base.transform.localScale = Vector3.one;
            mGridFocasable.cellHeight = 0f;
            mUIPracticeDeckTypeSelectChildrenFocusable = null;
            mFocus = null;
            List <UIPracticeDeckTypeSelectChild> list = new List <UIPracticeDeckTypeSelectChild>();

            UIPracticeDeckTypeSelectChild[] array = mUIPracticeDeckTypeSelectChildrenAll;
            foreach (UIPracticeDeckTypeSelectChild uIPracticeDeckTypeSelectChild in array)
            {
                uIPracticeDeckTypeSelectChild.gameObject.SetActive(false);
                uIPracticeDeckTypeSelectChild.transform.localPosition = Vector3.zero;
                uIPracticeDeckTypeSelectChild.SetOnClickListener(null);
                DeckPracticeType deckPracticeType = uIPracticeDeckTypeSelectChild.GetDeckPracticeType();
                if (selectableDeckPracticeTypes.ContainsKey(deckPracticeType))
                {
                    list.Add(uIPracticeDeckTypeSelectChild);
                    uIPracticeDeckTypeSelectChild.gameObject.SetActive(true);
                    uIPracticeDeckTypeSelectChild.transform.parent        = mGridFocasable.transform;
                    uIPracticeDeckTypeSelectChild.transform.localPosition = Vector3.zero;
                    uIPracticeDeckTypeSelectChild.transform.localScale    = Vector3.one;
                    uIPracticeDeckTypeSelectChild.ParentHasChanged();
                    uIPracticeDeckTypeSelectChild.SetOnClickListener(OnDeckTypeSelect);
                }
                else
                {
                    uIPracticeDeckTypeSelectChild.transform.parent = mTransform_ObjectPools;
                }
            }
            mUIPracticeDeckTypeSelectChildrenFocusable = list.ToArray();
        }
Example #3
0
 public void DisableButtonAll()
 {
     UIPracticeDeckTypeSelectChild[] array = this.mUIPracticeDeckTypeSelectChildrenAll;
     for (int i = 0; i < array.Length; i++)
     {
         UIPracticeDeckTypeSelectChild uIPracticeDeckTypeSelectChild = array[i];
         uIPracticeDeckTypeSelectChild.Enabled(false);
     }
 }
Example #4
0
 private void ChangeFocus(UIPracticeDeckTypeSelectChild target)
 {
     if (this.mFocus != null)
     {
         this.mFocus.RemoveHover();
     }
     this.mFocus = target;
     if (this.mFocus != null)
     {
         this.mFocus.Hover();
     }
 }
Example #5
0
 public void OnDeckTypeSelect(UIPracticeDeckTypeSelectChild selectedView)
 {
     this.ChangeFocus(selectedView);
     this.OnSelectedDeckPracticeType(this.mFocus.GetDeckPracticeType());
 }