Esempio n. 1
0
    void OnMouseDown()
    {
        if (da != null && da.CanDrag)
        {
            dragging = true;
            // when we are dragging something, all previews should be off
            HoverPreview.PreviewsAllowed = false;
            _draggingThis = this;
            da.OnStartDrag();
            pointerDisplacement = transform.position - MouseInWorldCoords();

            foreach (PlayerManager p in GameManager.Instance.players)
            {
                p.playerInput.InputEnabled = false;
            }

            if (gameObject.tag == "Top")
            {
                transform.DORotate(new Vector3(90, 0, -180), 0.1f);
            }
            else
            {
                transform.DORotate(new Vector3(90, 0, 0), 0.1f);
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Se mueve la carta o ente.
    /// </summary>
    public void Dragg()
    {
        if (da != null)
        {
            if (da.SePuedeArrastrar)
            {
                if (!dragging)
                {
                    dragging = true;
                    OpcionesObjeto.PrevisualizacionesPermitidas = false;
                    _draggingThis = this;
                    da.OnStartDrag();
                }

                Ray   mRay = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
                float rayDistance;
                if (objPlane.Raycast(mRay, out rayDistance))
                {
                    transform.position = mRay.GetPoint(rayDistance) + m0;
                }
                da.OnDraggingInUpdate();
            }
            else
            {
                if (dragging && !da.Reset)
                {
                    da.resetDragg();
                }
            }
        }
        //mostrar previsualizacion
    }
Esempio n. 3
0
 public void StartDragging()
 {
     _dragging = true;
     HoverPreview.PreviewsAllowed = false;
     _draggingThis = this;
     _da.OnStartDrag();
     _zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
     _pointerDisplacement = -transform.position + MouseInWorldCoords();
 }
Esempio n. 4
0
 public void StartDragging()
 {
     dragging = true;
     // when we are dragging something, all previews should be off
     HoverPreview.PreviewsAllowed = false;
     _draggingThis = this;
     da.OnStartDrag();
     zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
     pointerDisplacement = -transform.position + MouseInWorldCoords();
 }
Esempio n. 5
0
 void OnMouseDown()
 {
     if (draggingAction != null && draggingAction.CanDrag)
     {
         dragging = true;
         HoverPreview.PreviewsAllowed = false;
         DraggingThis = this;
         draggingAction.OnStartDrag();
         zDisplacement = -Camera.main.transform.position.z + draggableObject.position.z;
     }
 }
Esempio n. 6
0
 void OnMouseDown()
 {
     if (dragAction != null)
     {
         dragging = true;
         HoverPreview.PreviewsAllowed = false;
         _draggingThis = this;
         dragAction.OnStartDrag();
         zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
         pointerDisplacement = -transform.position + MouseInWorldCoords();
     }
 }
Esempio n. 7
0
 void OnMouseDown()
 {
     if (da != null && da.CanDrag)
     {
         dragging = true;
         // kiedy coś przeciągamy, wszystkie podglądy powinny być wyłączone
         HoverPreview.PreviewsAllowed = false;
         _draggingThis = this;
         da.OnStartDrag();
         zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
         pointerDisplacement = -transform.position + MouseInWorldCoords();
     }
 }
Esempio n. 8
0
 void OnMouseDown()
 {
     if (da != null && da.CanDrag)
     {
         dragging = true;
         //when we are dragging something all previews should be off
         HoverOnCard.PreviewsAllowed = false;
         _draggingThis = this;
         da.OnStartDrag();
         zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
         pointerDisplacement = -transform.position + MouseInWorldCoords();
     }
 }
Esempio n. 9
0
 void OnMouseDown()
 {
     if (da != null && da.CanDrag && whereIsTheCard.VisualState != VisualStates.Transition && whereIsTheCard.VisualState != VisualStates.TopTable && whereIsTheCard.VisualState != VisualStates.LowTable)
     {
         dragging = true;
         // when we are dragging something, all previews should be off
         HoverPreview.PreviewsAllowed = false;
         _draggingThis = this;
         da.OnStartDrag();
         zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
         pointerDisplacement = -transform.position + MouseInWorldCoords();
     }
 }
Esempio n. 10
0
 void OnMouseDown()
 {
     if (da != null && da.CanDrag)
     {
         DebugManager.Instance.DebugMessage("Beginning to drag.", DebugManager.MessageType.PlayerInteraction, gameObject);
         dragging = true;
         // when we are dragging something, all previews should be off
         HoverPreview.PreviewsAllowed = false;
         // All highlights should be turned off
         CardActionManager.Instance.UnHighlightAll();
         DraggingThis = this;
         da.OnStartDrag();
         zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
         pointerDisplacement = -transform.position + MouseInWorldCoords();
     }
 }
Esempio n. 11
0
    void OnMouseDown()
    {
        if (da != null && card.IsMine)
        {
            dragging = true;
            HoverPreview.PreviewsAllowed = false;
            _draggingThis = this;
            da.OnStartDrag();
            zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
            pointerDisplacement = -transform.position + MouseInWorldCoords();
        }

        /*
         * if(dragging && card.inPlay && card.isMine) {
         *  dt.OnStartDrag();
         * }
         */
    }
Esempio n. 12
0
    void OnMouseDown()
    {
        bool             isHighlighted    = false;
        MonsterManager   monsterManager   = this.transform.parent.GetComponent <MonsterManager>();
        SkillCardManager skillCardManager = this.transform.GetComponent <SkillCardManager>();

        isHighlighted = monsterManager != null ? monsterManager.CardFaceGlowImage.enabled : skillCardManager.CardFaceGlowImage.enabled;

        if (da != null && da.CanDrag() && isHighlighted)
        {
            dragging     = true;
            draggingThis = this;
            HoverPreview.PreviewsAllowed = false;
            zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
            pointerDisplacement = -transform.position + MouseInWorldCoords();

            da.OnStartDrag();
        }
    }
Esempio n. 13
0
 void OnMouseDown()
 {
     Debug.Log("In on mouse down");
     if (da.CanDrag)
     {
         dragging = true;
         //HoverPreview.PreviewsAllowed = false;       // NEW LINE
         da.OnStartDrag();
         zDisplacement = -Camera.main.transform.position.z + transform.position.z;
         if (UsePointerDisplacement)
         {
             pointerDisplacement = -transform.position + MouseInWorldCoords();
         }
         else
         {
             pointerDisplacement = Vector3.zero;
         }
     }
 }
Esempio n. 14
0
 void OnMouseDown()
 {
     //if (da != null && da.canDrag) {
     dragging = true;
     //when we drag, all preview should be off
     //HoverPreview.PreviewsAllowed = false;
     _draggingThis = this;
     da.OnStartDrag();
     zDisplacement = -Camera.main.transform.position.z + transform.position.z;
     if (UserPointerDisplacement)
     {
         pointerDisplacement = -transform.position + MouseInWorldCoords();
     }
     else
     {
         pointerDisplacement = Vector3.zero;
     }
     //}
 }