Exemple #1
0
        private void RegistEquipingSkillDrop(SkillElem skillElem, int slotIdx)
        {
            UGUIDrogListener.Get(skillElem.RootGo).onDrop = arg => {
                if (UIDragHelper.Instance.OnDrop(arg))
                {
                    if (null == mDragingSkill)
                    {
                        return;
                    }

                    List <SkillItem> tmpSkillItemList = mSkillLinkList[mSelectedEuqipedSoltIdx].SkillItems;
                    SkillItem        tmpSkillItem     = null;

                    if (slotIdx >= tmpSkillItemList.Count)
                    {
                        tmpSkillItem = new SkillItem();
                        tmpSkillItemList.Add(tmpSkillItem);
                    }
                    else
                    {
                        tmpSkillItem = tmpSkillItemList[slotIdx];
                    }

                    tmpSkillItem.Init(mDragingSkill.SkillBase.ID, 1);
                    RefreshEquipingSkill();

                    if (tmpSkillItemList.Count == 1 || slotIdx == 0)
                    {
                        RefreshEquipedSkill();
                    }
                }
            };
        }
Exemple #2
0
        protected static void RegisterEventClickEndDrag(GameObject go, UGUIDrogListener.VoidDelegate handle)
        {
            if (null == go || null == handle)
            {
                return;
            }

            UGUIDrogListener.Get(go).onEndDrag = handle;
        }
Exemple #3
0
 private void RegistSkillTreeDragEnd(SkillElem skillElem)
 {
     UGUIDrogListener.Get(skillElem.RootGo).onEndDrag = arg => {
         if (UIDragHelper.Instance.EndDrag(arg))
         {
             mDragingSkill = null;
         }
     };
 }
Exemple #4
0
 private void RegistSkillTreeDragBegin(SkillElem skillElem)
 {
     UGUIDrogListener.Get(skillElem.RootGo).onBeginDrag = arg => {
         if (UIDragHelper.Instance.BeginDrag(arg, skillElem.IconImg.gameObject, mGameObejct.transform))
         {
             mDragingSkill = skillElem;
         }
     };
 }
Exemple #5
0
    static public UGUIDrogListener Get(GameObject go)
    {
        UGUIDrogListener listener = go.GetComponent <UGUIDrogListener>();

        if (listener == null)
        {
            listener = go.AddComponent <UGUIDrogListener>();
        }
        return(listener);
    }
Exemple #6
0
        private void RegistEquipingSkillDragBegin(SkillElem skillElem, int slotIdx)
        {
            UGUIDrogListener.Get(skillElem.RootGo).onBeginDrag = arg => {
                if (null == skillElem.SkillBase)
                {
                    return;
                }

                if (UIDragHelper.Instance.BeginDrag(arg, skillElem.IconImg.gameObject, mGameObejct.transform))
                {
                }
            };
        }
Exemple #7
0
    // Use this for initialization
    public void Init(GameObject root, Image background, Image center)
    {
        mRoot          = root;
        mBackgroundImg = background;
        mCenterImg     = center;
        mBgInitPos     = mBackgroundImg.rectTransform.anchoredPosition;

        ChangeAlpha(false);
        mWorld2ScreenModify = 2521f / Screen.width;
        mRadius             = mBackgroundImg.rectTransform.sizeDelta.x * 0.5f - mCenterImg.rectTransform.sizeDelta.x * 0.5f;

        //UGUIEventListener.Get(root).onDown = OnPointerDown;
        //UGUIEventListener.Get(root).onUp = OnPointerUp;

        UGUIEventListener.Get(mRoot).onDown = OnBeginDrag;
        UGUIDrogListener.Get(mRoot).onDrag  = OnDraging;
        UGUIEventListener.Get(mRoot).onUp   = OnEndDrag;
    }
Exemple #8
0
        private void RegistEquipingSkillDragEnd(SkillElem skillElem, int slotIdx)
        {
            UGUIDrogListener.Get(skillElem.RootGo).onEndDrag = arg => {
                if (UIDragHelper.Instance.EndDrag(arg))
                {
                    if (arg.pointerCurrentRaycast.gameObject != skillElem.RootGo)
                    {
                        List <SkillItem> tmpSkillItemList = mSkillLinkList[mSelectedEuqipedSoltIdx].SkillItems;

                        if (slotIdx < tmpSkillItemList.Count)
                        {
                            tmpSkillItemList.RemoveAt(slotIdx);
                        }

                        RefreshEquipingSkill();

                        if (tmpSkillItemList.Count == 0 || slotIdx == 0)
                        {
                            RefreshEquipedSkill();
                        }
                    }
                }
            };
        }
Exemple #9
0
 private void RegistEquipingSkillDrag(SkillElem skillElem)
 {
     UGUIDrogListener.Get(skillElem.RootGo).onDrag = arg => {
         UIDragHelper.Instance.Draging(arg);
     };
 }