Exemple #1
0
 // 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();
         }
     }
 }
Exemple #2
0
    /// <summary>
    /// Start the dragging operation.
    /// </summary>

    public 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>();
                item.mTouch    = mTouch;
                item.mPressed  = true;
                item.mDragging = true;
                item.Start();
                item.OnClone(gameObject);
                item.OnDragDropStart();
                item.onRelease = onRelease;

                if (UICamera.currentTouch == null)
                {
                    UICamera.currentTouch = mTouch;
                }

                mTouch = null;

                UICamera.Notify(gameObject, "OnPress", false);
                UICamera.Notify(gameObject, "OnHover", false);
            }
            else
            {
                mDragging = true;
                OnDragDropStart();
            }
        }
    }
Exemple #3
0
 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();
         }
     }
 }
Exemple #4
0
    /// <summary>
    /// Start the dragging operation.
    /// </summary>

    public virtual void StartDragging()
    {
        if (!interactable)
        {
            return;
        }

        if (!mDragging)
        {
            if (cloneOnDrag)
            {
                mPressed = false;
                GameObject clone = transform.parent.gameObject.AddChild(gameObject);
                clone.transform.localPosition = transform.localPosition;
                clone.transform.localRotation = transform.localRotation;
                clone.transform.localScale    = transform.localScale;
                Transform cloneTF = clone.transform.FindRecursively("icon");
                if (cloneTF)
                {
                    UISprite cloneSprite = clone.GetComponent <UISprite>();
                    UISprite iconSprite  = cloneTF.GetComponent <UISprite>();
                    cloneSprite.depth = cloneSprite.depth + 2;
                    iconSprite.depth  = iconSprite.depth + 2;
                }
                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>();
                item.mTouch    = mTouch;
                item.mPressed  = true;
                item.mDragging = true;
                item.Start();
                item.OnClone(gameObject);
                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();
            }
        }
    }
    /// <summary>
    /// Start the dragging operation.
    /// </summary>

    public virtual void StartDragging()
    {
        if (!interactable)
        {
            return;
        }

        if (!mDragging)
        {
            if (cloneOnDrag)
            {
                mPressed = false;
                GameObject clone = transform.parent.gameObject.AddChild(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;
                }

                // OCTOBOX MODIFICATION
                // Remove anchoring from the cloned item or else item won't be draggable
                UIWidget widget = clone.GetComponent <UIWidget>();
                if (widget != null)
                {
                    widget.SetAnchor((GameObject)null);
                }


                UIDragDropItem item = clone.GetComponent <UIDragDropItem>();
                item.mTouch    = mTouch;
                item.mPressed  = true;
                item.mDragging = true;
                item.OnClonedFrom(this);                                 // OCTOBOX MODIFICATION: pass custom data to a cloned object.
                item.Start();
                item.OnClone(gameObject);
                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();
            }
        }
    }