/// <summary> /// Start the dragging operation. /// </summary> protected virtual void StartDragging() { if (!mDragging) { if (cloneOnDrag) { GameObject clone = NGUITools.AddChild(transform.parent.gameObject, gameObject); clone.transform.localPosition = transform.localPosition; clone.transform.localRotation = transform.localRotation; clone.transform.localScale = transform.localScale; UIButtonColor bc = clone.GetComponent <UIButtonColor>(); if (bc != null) { bc.defaultColor = GetComponent <UIButtonColor>().defaultColor; } UICamera.currentTouch.dragged = clone; UIDragDropItem item = clone.GetComponent <UIDragDropItem>(); item.mDragging = true; item.Start(); item.OnDragDropStart(); } else { mDragging = true; OnDragDropStart(); } } }
// Token: 0x06003060 RID: 12384 RVA: 0x000E9780 File Offset: 0x000E7B80 protected virtual void StartDragging() { if (!this.mDragging) { if (this.cloneOnDrag) { GameObject gameObject = NGUITools.AddChild(base.transform.parent.gameObject, base.gameObject); gameObject.transform.localPosition = base.transform.localPosition; gameObject.transform.localRotation = base.transform.localRotation; gameObject.transform.localScale = base.transform.localScale; UIButtonColor component = gameObject.GetComponent <UIButtonColor>(); if (component != null) { component.defaultColor = base.GetComponent <UIButtonColor>().defaultColor; } UICamera.currentTouch.dragged = gameObject; UIDragDropItem component2 = gameObject.GetComponent <UIDragDropItem>(); component2.mDragging = true; component2.Start(); component2.OnDragDropStart(); } else { this.mDragging = true; this.OnDragDropStart(); } } }
/// <summary> /// Start the dragging operation. /// </summary> void OnDragStart() { if (!enabled || mTouchID != int.MinValue) { return; } // If we have a restriction, check to see if its condition has been met first if (restriction != Restriction.None) { if (restriction == Restriction.Horizontal) { Vector2 delta = UICamera.currentTouch.totalDelta; if (Mathf.Abs(delta.x) < Mathf.Abs(delta.y)) { return; } } else if (restriction == Restriction.Vertical) { Vector2 delta = UICamera.currentTouch.totalDelta; if (Mathf.Abs(delta.x) > Mathf.Abs(delta.y)) { return; } } else if (restriction == Restriction.PressAndHold) { if (mPressTime + pressAndHoldDelay > RealTime.time) { return; } } } if (cloneOnDrag) { GameObject clone = NGUITools.AddChild(transform.parent.gameObject, gameObject); clone.transform.localPosition = transform.localPosition; clone.transform.localRotation = transform.localRotation; clone.transform.localScale = transform.localScale; UIButtonColor bc = clone.GetComponent <UIButtonColor>(); if (bc != null) { bc.defaultColor = GetComponent <UIButtonColor>().defaultColor; } UICamera.currentTouch.dragged = clone; UIDragDropItem item = clone.GetComponent <UIDragDropItem>(); item.originalItem = this; item.Start(); item.OnDragDropStart(); } else { OnDragDropStart(); } }
// Use this for initialization protected virtual void Start () { dragScript = (UIDragDropItem)GetComponent(typeof(UIDragDropItem)); DragToggle(Draggable); if(outputNodeParent != null) { outputDragNodes = new List<DragNode>(outputNodeParent.GetComponentsInChildren<DragNode>()); } if(inputNodeParent != null) { inputDragNodes = new List<DragNode>(inputNodeParent.GetComponentsInChildren<DragNode>()); } NodeColor = this.GetComponent<UISprite>().color; if(outputDragNodes != null) { foreach(DragNode n in outputDragNodes) { n.ParentNode = this; n.name += "OUT"; n.IsInput = false; n.NodeSprite.color = NodeColor; } } if(inputDragNodes != null) { foreach(DragNode n in inputDragNodes) { n.ParentNode = this; n.IsInput = true; n.name += "IN"; n.NodeSprite.color = NodeColor; } } Randomizer.OnPuzzleCreated += NewPuzzle; }
/// <summary> /// Start the dragging operation. /// </summary> protected virtual void StartDragging() { if (!interactable) { return; } if (!mDragging) { if (cloneOnDrag) { mPressed = false; GameObject clone = NGUITools.AddChild(transform.parent.gameObject, gameObject); clone.transform.localPosition = transform.localPosition; clone.transform.localRotation = transform.localRotation; clone.transform.localScale = transform.localScale; UIButtonColor bc = clone.GetComponent <UIButtonColor>(); if (bc != null) { bc.defaultColor = GetComponent <UIButtonColor>().defaultColor; } if (mTouch != null && mTouch.pressed == gameObject) { mTouch.current = clone; mTouch.pressed = clone; mTouch.dragged = clone; mTouch.last = clone; } UIDragDropItem item = clone.GetComponent <UIDragDropItem>(); if (onDosomething != null) { onDosomething(item); } item.mTouch = mTouch; item.mPressed = true; item.mDragging = true; item.Start(); item.OnDragDropStart(); if (UICamera.currentTouch == null) { UICamera.currentTouch = mTouch; } mTouch = null; UICamera.Notify(gameObject, "OnPress", false); UICamera.Notify(gameObject, "OnHover", false); } else { mDragging = true; OnDragDropStart(); } } }
// Token: 0x06000C0F RID: 3087 RVA: 0x00068AE4 File Offset: 0x00066CE4 public virtual void StartDragging() { if (!this.interactable) { return; } if (!this.mDragging) { if (this.cloneOnDrag) { this.mPressed = false; GameObject gameObject; if (this.cloneObject != null) { gameObject = base.transform.parent.gameObject.BFCKNMFEBDM(this.cloneObject); gameObject.transform.position = EMENMKHBPQE.DKIMLEKEFCB.point; } else { gameObject = base.transform.parent.gameObject.BFCKNMFEBDM(base.gameObject); gameObject.transform.localPosition = base.transform.localPosition; } gameObject.transform.localRotation = base.transform.localRotation; gameObject.transform.localScale = base.transform.localScale; PBJKDKBOLHO component = gameObject.GetComponent <PBJKDKBOLHO>(); if (component != null) { component.IDEOONDHNEL = base.GetComponent <PBJKDKBOLHO>().IDEOONDHNEL; } if (this.mTouch != null && this.mTouch.KCICOJFDCPQ == base.gameObject) { this.mTouch.OMQCQCBLQGJ = gameObject; this.mTouch.KCICOJFDCPQ = gameObject; this.mTouch.HKGQKLHJKMB = gameObject; this.mTouch.CIDFMGENPFQ = gameObject; } UIDragDropItem component2 = gameObject.GetComponent <UIDragDropItem>(); component2.mTouch = this.mTouch; component2.mPressed = true; component2.mDragging = true; component2.Start(); component2.OnClone(base.gameObject); component2.GetClone(gameObject, base.gameObject); component2.OnDragDropStart(); if (EMENMKHBPQE.JHEDGGMDIEE == null) { EMENMKHBPQE.JHEDGGMDIEE = this.mTouch; } this.mTouch = null; EMENMKHBPQE.EHDBBNFQIBL(base.gameObject, "OnPress", false); EMENMKHBPQE.EHDBBNFQIBL(base.gameObject, "OnHover", false); } else { this.mDragging = true; this.OnDragDropStart(); } } }
private void Awake() { this.m_dragdrop = base.GetComponent <UIDragDropItem>(); if (null == this.m_dragdrop) { Debug.LogError("null == m_dragdrop"); } }
static int SetLimit(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 5); UIDragDropItem obj = (UIDragDropItem)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIDragDropItem"); float arg0 = (float)LuaScriptMgr.GetNumber(L, 2); float arg1 = (float)LuaScriptMgr.GetNumber(L, 3); float arg2 = (float)LuaScriptMgr.GetNumber(L, 4); float arg3 = (float)LuaScriptMgr.GetNumber(L, 5); obj.SetLimit(arg0, arg1, arg2, arg3); return(0); }
static public int get_cloneOnDrag(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); pushValue(l, true); pushValue(l, self.cloneOnDrag); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int StartDragging(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); self.StartDragging(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int get_restriction(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); pushValue(l, true); pushEnum(l, (int)self.restriction); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int get_pressAndHoldDelay(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); pushValue(l, true); pushValue(l, self.pressAndHoldDelay); return(2); } catch (Exception e) { return(error(l, e)); } }
private void OnDragStart() { if (!base.enabled || this.mTouchID != -2147483648) { return; } if (this.restriction != UIDragDropItem.Restriction.None) { if (this.restriction == UIDragDropItem.Restriction.Horizontal) { Vector2 totalDelta = UICamera.currentTouch.totalDelta; if (Mathf.Abs(totalDelta.x) < Mathf.Abs(totalDelta.y)) { return; } } else if (this.restriction == UIDragDropItem.Restriction.Vertical) { Vector2 totalDelta2 = UICamera.currentTouch.totalDelta; if (Mathf.Abs(totalDelta2.x) > Mathf.Abs(totalDelta2.y)) { return; } } else if (this.restriction == UIDragDropItem.Restriction.PressAndHold && this.mPressTime + 1f > RealTime.time) { return; } } if (this.cloneOnDrag) { GameObject gameObject = NGUITools.AddChild(base.transform.parent.gameObject, base.gameObject); gameObject.transform.localPosition = base.transform.localPosition; gameObject.transform.localRotation = base.transform.localRotation; gameObject.transform.localScale = base.transform.localScale; UIButtonColor component = gameObject.GetComponent <UIButtonColor>(); if (component != null) { component.defaultColor = base.GetComponent <UIButtonColor>().defaultColor; } UICamera.Notify(UICamera.currentTouch.pressed, "OnPress", false); UICamera.currentTouch.pressed = gameObject; UICamera.currentTouch.dragged = gameObject; UIDragDropItem component2 = gameObject.GetComponent <UIDragDropItem>(); component2.Start(); component2.OnDragDropStart(); } else { this.OnDragDropStart(); } }
static public int set_restriction(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); UIDragDropItem.Restriction v; checkEnum(l, 2, out v); self.restriction = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_cloneOnDrag(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); System.Boolean v; checkType(l, 2, out v); self.cloneOnDrag = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
private void OnDragStart() { if (!base.enabled || mTouchID != int.MinValue) { return; } if (restriction != 0) { if (restriction == Restriction.Horizontal) { Vector2 totalDelta = UICamera.currentTouch.totalDelta; if (Mathf.Abs(totalDelta.x) < Mathf.Abs(totalDelta.y)) { return; } } else if (restriction == Restriction.Vertical) { Vector2 totalDelta = UICamera.currentTouch.totalDelta; if (Mathf.Abs(totalDelta.x) > Mathf.Abs(totalDelta.y)) { return; } } else if (restriction == Restriction.PressAndHold && mPressTime + pressAndHoldDelay > RealTime.time) { return; } } if (cloneOnDrag) { GameObject gameObject = NGUITools.AddChild(base.transform.parent.gameObject, base.gameObject); gameObject.transform.localPosition = base.transform.localPosition; gameObject.transform.localRotation = base.transform.localRotation; gameObject.transform.localScale = base.transform.localScale; UIButtonColor component = gameObject.GetComponent <UIButtonColor>(); if (component != null) { component.defaultColor = GetComponent <UIButtonColor>().defaultColor; } UICamera.currentTouch.dragged = gameObject; UIDragDropItem component2 = gameObject.GetComponent <UIDragDropItem>(); component2.Start(); component2.OnDragDropStart(); } else { OnDragDropStart(); } }
static public int StopDragging(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); UnityEngine.GameObject a1; checkType(l, 2, out a1); self.StopDragging(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_pressAndHoldDelay(IntPtr l) { try { UIDragDropItem self = (UIDragDropItem)checkSelf(l); System.Single v; checkType(l, 2, out v); self.pressAndHoldDelay = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
public virtual void StartDragging() { if (!this.interactable) { return; } if (!this.mDragging) { if (this.cloneOnDrag) { this.mPressed = false; GameObject gameObject = base.transform.parent.gameObject.AddChild(base.gameObject); gameObject.transform.localPosition = base.transform.localPosition; gameObject.transform.localRotation = base.transform.localRotation; gameObject.transform.localScale = base.transform.localScale; UIButtonColor component = gameObject.GetComponent <UIButtonColor>(); if (component != null) { component.defaultColor = base.GetComponent <UIButtonColor>().defaultColor; } if (this.mTouch != null && this.mTouch.pressed == base.gameObject) { this.mTouch.current = gameObject; this.mTouch.pressed = gameObject; this.mTouch.dragged = gameObject; this.mTouch.last = gameObject; } UIDragDropItem component2 = gameObject.GetComponent <UIDragDropItem>(); component2.mTouch = this.mTouch; component2.mPressed = true; component2.mDragging = true; component2.Start(); component2.OnClone(base.gameObject); component2.OnDragDropStart(); if (UICamera.currentTouch == null) { UICamera.currentTouch = this.mTouch; } this.mTouch = null; UICamera.Notify(base.gameObject, "OnPress", false); UICamera.Notify(base.gameObject, "OnHover", false); } else { this.mDragging = true; this.OnDragDropStart(); } } }
static int StopDragging(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIDragDropItem obj = (UIDragDropItem)ToLua.CheckObject <UIDragDropItem>(L, 1); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 2, typeof(UnityEngine.GameObject)); obj.StopDragging(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_cloneOnDrag(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; bool ret = obj.cloneOnDrag; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cloneOnDrag on a nil value")); } }
static int get_pressAndHoldDelay(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; float ret = obj.pressAndHoldDelay; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index pressAndHoldDelay on a nil value")); } }
static int set_interactable(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.interactable = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index interactable on a nil value")); } }
static int set_pressAndHoldDelay(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.pressAndHoldDelay = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index pressAndHoldDelay on a nil value")); } }
static int set_restriction(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; UIDragDropItem.Restriction arg0 = (UIDragDropItem.Restriction)ToLua.CheckObject(L, 2, typeof(UIDragDropItem.Restriction)); obj.restriction = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index restriction on a nil value")); } }
static int get_interactable(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; bool ret = obj.interactable; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index interactable on a nil value" : e.Message)); } }
static int get_restriction(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; UIDragDropItem.Restriction ret = obj.restriction; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index restriction on a nil value")); } }
static int set_cloneOnDrag(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIDragDropItem obj = (UIDragDropItem)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.cloneOnDrag = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index cloneOnDrag on a nil value" : e.Message)); } }
protected virtual void StartDragging() { if (!interactable || mDragging) { return; } if (cloneOnDrag) { mPressed = false; GameObject gameObject = NGUITools.AddChild(base.transform.parent.gameObject, base.gameObject); gameObject.transform.localPosition = base.transform.localPosition; gameObject.transform.localRotation = base.transform.localRotation; gameObject.transform.localScale = base.transform.localScale; UIButtonColor component = gameObject.GetComponent <UIButtonColor>(); if (component != null) { component.defaultColor = GetComponent <UIButtonColor>().defaultColor; } if (mTouch != null && mTouch.pressed == base.gameObject) { mTouch.current = gameObject; mTouch.pressed = gameObject; mTouch.dragged = gameObject; mTouch.last = gameObject; } UIDragDropItem component2 = gameObject.GetComponent <UIDragDropItem>(); component2.mTouch = mTouch; component2.mPressed = true; component2.mDragging = true; component2.Start(); component2.OnDragDropStart(); if (UICamera.currentTouch == null) { UICamera.currentTouch = mTouch; } mTouch = null; UICamera.Notify(base.gameObject, "OnPress", false); UICamera.Notify(base.gameObject, "OnHover", false); } else { mDragging = true; OnDragDropStart(); } }
// Token: 0x060001BD RID: 445 RVA: 0x00015CA8 File Offset: 0x00013EA8 protected virtual void OnClick() { if (UIDragDropItem.mIgnoreClick == Time.frameCount) { return; } if (this.clickToDrag && !this.mDragging && UICamera.currentTouchID == -1 && UIDragDropItem.draggedItems.Count == 0) { this.mTouch = UICamera.currentTouch; UIDragDropItem uidragDropItem = this.StartDragging(); if (this.clickToDrag && uidragDropItem != null) { UICamera.onMouseMove = (UICamera.MoveDelegate)Delegate.Combine(UICamera.onMouseMove, new UICamera.MoveDelegate(uidragDropItem.OnDrag)); UICamera.onPress = (UICamera.BoolDelegate)Delegate.Combine(UICamera.onPress, new UICamera.BoolDelegate(uidragDropItem.OnGlobalPress)); UICamera.onClick = (UICamera.VoidDelegate)Delegate.Combine(UICamera.onClick, new UICamera.VoidDelegate(uidragDropItem.OnGlobalClick)); } } }
/// <summary> /// Get the current list of the grid's children. /// </summary> public List <Transform> GetChildList() { Transform myTrans = transform; List <Transform> list = new List <Transform>(); for (int i = 0; i < myTrans.childCount; ++i) { Transform t = myTrans.GetChild(i); if (!hideInactive || (t && t.gameObject.activeSelf)) { if (!UIDragDropItem.IsDragged(t.gameObject)) { list.Add(t); } } } // Sort the list using the desired sorting logic if (sorting != Sorting.None && arrangement != Arrangement.CellSnap) { if (sorting == Sorting.Alphabetic) { list.Sort(SortByName); } else if (sorting == Sorting.Horizontal) { list.Sort(SortHorizontal); } else if (sorting == Sorting.Vertical) { list.Sort(SortVertical); } else if (onCustomSort != null) { list.Sort(onCustomSort); } else { Sort(list); } } return(list); }
void Start(){ mDragDropItem = GetComponent<UIDragDropItem> (); }