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(); } } }; }
protected static void RegisterEventClickEndDrag(GameObject go, UGUIDrogListener.VoidDelegate handle) { if (null == go || null == handle) { return; } UGUIDrogListener.Get(go).onEndDrag = handle; }
private void RegistSkillTreeDragEnd(SkillElem skillElem) { UGUIDrogListener.Get(skillElem.RootGo).onEndDrag = arg => { if (UIDragHelper.Instance.EndDrag(arg)) { mDragingSkill = null; } }; }
private void RegistSkillTreeDragBegin(SkillElem skillElem) { UGUIDrogListener.Get(skillElem.RootGo).onBeginDrag = arg => { if (UIDragHelper.Instance.BeginDrag(arg, skillElem.IconImg.gameObject, mGameObejct.transform)) { mDragingSkill = skillElem; } }; }
static public UGUIDrogListener Get(GameObject go) { UGUIDrogListener listener = go.GetComponent <UGUIDrogListener>(); if (listener == null) { listener = go.AddComponent <UGUIDrogListener>(); } return(listener); }
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)) { } }; }
// 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; }
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(); } } } }; }
private void RegistEquipingSkillDrag(SkillElem skillElem) { UGUIDrogListener.Get(skillElem.RootGo).onDrag = arg => { UIDragHelper.Instance.Draging(arg); }; }