/// <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 }
// Update is called once per frame void Update() { if (dragging) { Vector3 mousePos = MouseInWorldCoords(); transform.position = new Vector3(mousePos.x - pointerDisplacement.x, mousePos.y - pointerDisplacement.y, transform.position.z); da.OnDraggingInUpdate(); } }
void Update() { if (dragging) { Vector3 mousePos = MouseInWorldCoords(); draggableObject.position = new Vector3(mousePos.x, mousePos.y, draggableObject.position.z); draggingAction.OnDraggingInUpdate(draggableObject); } }
// Update is called once per frame void Update() { if (dragging) { Vector3 mousePos = MouseInWorldCoords(); //Debug.Log(mousePos); transform.position = new Vector3(mousePos.x + pointerDisplacement.x, transform.position.y, mousePos.z + pointerDisplacement.z); da.OnDraggingInUpdate(); } }
void Update() { if (dragging && card.isMine && !card.Inplay) { Vector3 mousePos = MouseInWorldCoords(); transform.position = new Vector3(mousePos.x - pointerDisplacement.x, mousePos.y - pointerDisplacement.y, transform.position.z); da.OnDraggingInUpdate(); } /* * if(dragging && card.inPlay && card.isMine) { * dt.OnDraggingInUpdate(); * } */ }