Ejemplo n.º 1
0
 private void ChangeFocus(UIItemListChild child, bool playSE)
 {
     if (this.mFocusListChild != null)
     {
         this.mFocusListChild.RemoveFocus();
         ShortcutExtensions.DOScale(this.mFocusListChild.get_transform(), new Vector3(1f, 1f), 0.3f);
         ShortcutExtensions.DOScale(this.mTransform_Focus, new Vector3(1f, 1f), 0.3f);
     }
     this.mFocusListChild = child;
     if (this.mFocusListChild != null)
     {
         this.OnFocusChange(this.mFocusListChild.mModel);
         this.mFocusListChild.Focus();
         if (child.IsFosable())
         {
             this.mTransform_Focus.set_localPosition(new Vector3(this.mFocusListChild.get_transform().get_localPosition().x, this.mFocusListChild.get_transform().get_localPosition().y - 12f));
             ShortcutExtensions.DOScale(this.mTransform_Focus, new Vector3(1.2f, 1.2f), 0.3f);
             ShortcutExtensions.DOScale(this.mFocusListChild.get_transform(), new Vector3(1.2f, 1.2f), 0.3f);
         }
         else
         {
             this.mTransform_Focus.set_localPosition(new Vector3(this.mFocusListChild.get_transform().get_localPosition().x, this.mFocusListChild.get_transform().get_localPosition().y - 12f));
         }
         if (playSE)
         {
             this.SafePlaySEOneShot(this.mAudioClip_SE_001);
         }
     }
     else
     {
         this.mTransform_Focus.get_transform().set_localPosition(new Vector3(this.mItemListChildren[0].get_transform().get_localPosition().x, this.mItemListChildren[0].get_transform().get_localPosition().y - 12f));
         this.OnFocusChange(null);
     }
 }
Ejemplo n.º 2
0
 private void OnTouchListChild(UIItemListChild child)
 {
     if (mKeyController != null && child != null && child.isActiveAndEnabled)
     {
         ChangeFocus(child, playSE: true);
     }
 }
Ejemplo n.º 3
0
 private void OnSelectListInChild(UIItemListChild itemListChild)
 {
     if (itemListChild != null && mItemListChildDetai.Usable())
     {
         mItemList.SetKeyController(null);
         PushState(State.UseCheck);
     }
 }
Ejemplo n.º 4
0
        private void OnTouchListChild(UIItemListChild child)
        {
            bool flag = this.mKeyController != null;

            if (flag && child != null && child.get_isActiveAndEnabled())
            {
                this.ChangeFocus(child, true);
            }
        }
Ejemplo n.º 5
0
 private void Awake()
 {
     UIItemListChild[] array = this.mItemListChildren;
     for (int i = 0; i < array.Length; i++)
     {
         UIItemListChild uIItemListChild = array[i];
         uIItemListChild.SetOnTouchListener(new Action <UIItemListChild>(this.OnTouchListChild));
     }
     this.mAudioClip_SE_001 = SoundFile.LoadSE(SEFIleInfos.SE_001);
     this.mAudioClip_SE_013 = SoundFile.LoadSE(SEFIleInfos.SE_013);
 }
Ejemplo n.º 6
0
 private void ChangeFocus(UIItemListChild child, bool playSE)
 {
     if (mFocusListChild != null)
     {
         mFocusListChild.RemoveFocus();
         mFocusListChild.transform.DOScale(new Vector3(1f, 1f), 0.3f);
         mTransform_Focus.DOScale(new Vector3(1f, 1f), 0.3f);
     }
     mFocusListChild = child;
     if (mFocusListChild != null)
     {
         OnFocusChange(mFocusListChild.mModel);
         mFocusListChild.Focus();
         if (child.IsFosable())
         {
             Transform transform      = mTransform_Focus;
             Vector3   localPosition  = mFocusListChild.transform.localPosition;
             float     x              = localPosition.x;
             Vector3   localPosition2 = mFocusListChild.transform.localPosition;
             transform.localPosition = new Vector3(x, localPosition2.y - 12f);
             mTransform_Focus.DOScale(new Vector3(1.2f, 1.2f), 0.3f);
             mFocusListChild.transform.DOScale(new Vector3(1.2f, 1.2f), 0.3f);
         }
         else
         {
             Transform transform2     = mTransform_Focus;
             Vector3   localPosition3 = mFocusListChild.transform.localPosition;
             float     x2             = localPosition3.x;
             Vector3   localPosition4 = mFocusListChild.transform.localPosition;
             transform2.localPosition = new Vector3(x2, localPosition4.y - 12f);
         }
         if (playSE)
         {
             SafePlaySEOneShot(mAudioClip_SE_001);
         }
     }
     else
     {
         Transform transform3     = mTransform_Focus.transform;
         Vector3   localPosition5 = mItemListChildren[0].transform.localPosition;
         float     x3             = localPosition5.x;
         Vector3   localPosition6 = mItemListChildren[0].transform.localPosition;
         transform3.localPosition = new Vector3(x3, localPosition6.y - 12f);
         OnFocusChange(null);
     }
 }
Ejemplo n.º 7
0
        public void Initialize(ItemlistModel[] models)
        {
            int num  = 0;
            int num2 = models.Length;

            UIItemListChild[] array = this.mItemListChildren;
            for (int i = 0; i < array.Length; i++)
            {
                UIItemListChild uIItemListChild = array[i];
                uIItemListChild.SetActive(true);
                if (num < num2)
                {
                    uIItemListChild.Initialize(models[num]);
                }
                else
                {
                    uIItemListChild.Initialize(new ItemlistModel(null, null, string.Empty));
                }
                num++;
            }
            this.ChangeFocus(null, false);
        }
Ejemplo n.º 8
0
        public void Refresh(ItemlistModel[] models)
        {
            int num  = Array.IndexOf <UIItemListChild>(this.mItemListChildren, this.mFocusListChild);
            int num2 = 0;
            int num3 = models.Length;

            UIItemListChild[] array = this.mItemListChildren;
            for (int i = 0; i < array.Length; i++)
            {
                UIItemListChild uIItemListChild = array[i];
                if (num2 < num3)
                {
                    uIItemListChild.SetActive(true);
                    uIItemListChild.Initialize(models[num2]);
                }
                else
                {
                    uIItemListChild.SetActive(false);
                }
                num2++;
            }
            this.ChangeFocus(this.mItemListChildren[num], false);
        }