Exemplo n.º 1
0
 public void OnManipulationCompleted(ManipulationEventData eventData)
 {
     Debug.LogFormat("OnManipulationCompleted\r\nSource: {0}  SourceId: {1}\r\nCumulativeDelta: {2} {3} {4}",
         eventData.InputSource,
         eventData.SourceId,
         eventData.CumulativeDelta.x,
         eventData.CumulativeDelta.y,
         eventData.CumulativeDelta.z);
 }
Exemplo n.º 2
0
 public void OnManipulationCanceled(ManipulationEventData eventData)
 {
     rb.isKinematic = false;
 }
Exemplo n.º 3
0
 public void OnManipulationStarted(ManipulationEventData eventData)
 {
     rb.isKinematic = true;
 }
 public void OnManipulationStared(ManipulationEventData data)
 {
     isManipulate = true;
 }
Exemplo n.º 5
0
 public void OnManipulationCompleted(ManipulationEventData eventData)
 {
     this.Done();
 }
Exemplo n.º 6
0
 public void OnManipulationCompleted(ManipulationEventData eventData)
 {
     Delta = Vector3.zero;
     InputManager.Instance.OverrideFocusedObject = null;
 }
Exemplo n.º 7
0
 public void OnManipulationStarted(ManipulationEventData eventData)
 {
 }
Exemplo n.º 8
0
 public void OnManipulationCanceled(ManipulationEventData eventData)
 {
 }
 private void OnManipulationEnded(ManipulationEventData manipulationEventData)
 {
     isManipulating = false;
 }
Exemplo n.º 10
0
 private void OnManipulationStarted(ManipulationEventData manipulationEventData)
 {
     // In order to manipulate objects we need to request ownership
     realtimeTransform.RequestOwnership();
     isManipulating = true;
 }
Exemplo n.º 11
0
 public void OnManipulationCanceled(ManipulationEventData eventData)
 {
     print("OnManipCanceled");
 }
Exemplo n.º 12
0
 public void OnManipulationCompleted(ManipulationEventData eventData)
 {
     print("OnManipCompleted");
 }
Exemplo n.º 13
0
    public void OnManipulationStarted(ManipulationEventData eventData)
    {
        print("OnManipStarted");

        savedPos = obj.transform.position;
    }
 void IManipulationHandler.OnManipulationCompleted(ManipulationEventData eventData)
 {
     InputManager.Instance.PopModalInputHandler();
 }
Exemplo n.º 15
0
 public void OnManipulationStarted(ManipulationEventData eventData)
 {
     InputManager.Instance.PushModalInputHandler(gameObject);
     lastPosition = transform.position;
 }
Exemplo n.º 16
0
 public void OnManipulationUpdated(ManipulationEventData eventData)
 {
     if (LogGesturesUpdateEvents)
     {
         Debug.LogFormat("OnManipulationUpdated\r\nSource: {0}  SourceId: {1}\r\nCumulativeDelta: {2} {3} {4}",
             eventData.InputSource,
             eventData.SourceId,
             eventData.CumulativeDelta.x,
             eventData.CumulativeDelta.y,
             eventData.CumulativeDelta.z);
     }
 }
Exemplo n.º 17
0
 private void OnItemManipulated(ManipulationEventData arg0)
 {
     OnItemManipulated();
 }
 void IManipulationHandler.OnManipulationCanceled(ManipulationEventData eventData)
 {
     GetComponentInChildren <MeshRenderer>().material.color = Color.cyan;
     ManipulationDone();
 }
Exemplo n.º 19
0
 public void OnManipulationCompleted(ManipulationEventData eventData)
 {
 }
Exemplo n.º 20
0
 public void OnManipulationUpdated(ManipulationEventData eventData) => _text.text   = "OnManipulationUpdated";
Exemplo n.º 21
0
    public void OnManipulationUpdated(ManipulationEventData eventData)
    {
        if (MenuManager.Instance.isScaling)
        {
            float val;

            Vector3 moveVector = Vector3.zero;
            moveVector = eventData.CumulativeDelta - previousPosition;

            previousPosition = eventData.CumulativeDelta;

            if (gameObject.tag == "Left")
            {
                if ((gameObject.transform.position + gameObject.transform.right * moveVector.x).x <= minX || (gameObject.transform.position + gameObject.transform.right * moveVector.x).x < gameObject.transform.position.x)
                {
                    //Move the border to the left.
                    gameObject.transform.position += gameObject.transform.right * moveVector.x;

                    //Get the distance between the left and right border, then scale properly the top/bottom borders.
                    val = Vector3.Distance(box[2].transform.position, gameObject.transform.position);
                    box[1].transform.localScale = new Vector3(val + (1 * 0.02f), box[1].transform.localScale.y, box[1].transform.localScale.z);
                    box[3].transform.localScale = box[1].transform.localScale;

                    //Position the top/bottom borders between the right/left borders.
                    box[1].transform.position += box[1].transform.right * (moveVector.x / 2);
                    box[3].transform.position += box[3].transform.right * (moveVector.x / 2);
                }
            }
            else if (gameObject.tag == "Up")
            {
                if ((gameObject.transform.position + gameObject.transform.up * moveVector.y).y >= maxY || (gameObject.transform.position + gameObject.transform.up * moveVector.y).y > gameObject.transform.position.y)
                {
                    //Move the border Up.
                    gameObject.transform.position += gameObject.transform.up * moveVector.y;

                    //Get the distance between the top and bottom border, then scale properly the right/left borders.
                    val = Vector3.Distance(gameObject.transform.position, box[3].transform.position);
                    box[0].transform.localScale = new Vector3(box[0].transform.localScale.x, val + (1 * 0.02f), box[0].transform.localScale.z);
                    box[2].transform.localScale = box[0].transform.localScale;

                    //Position the right/left borders between the top/bottom borders.
                    box[0].transform.position += box[0].transform.up * (moveVector.y / 2);
                    box[2].transform.position += box[2].transform.up * (moveVector.y / 2);
                }
            }
            else if (gameObject.tag == "Right")
            {
                if ((gameObject.transform.position + gameObject.transform.right * moveVector.x).x >= maxX || (gameObject.transform.position + gameObject.transform.right * moveVector.x).x > gameObject.transform.position.x)
                {
                    //Move the border to the right.
                    gameObject.transform.position += gameObject.transform.right * moveVector.x;

                    //Get the distance between the left and right border, then scale properly the top/bottom borders.
                    val = Vector3.Distance(box[0].transform.position, gameObject.transform.position);
                    box[1].transform.localScale = new Vector3(val + (1 * 0.02f), box[1].transform.localScale.y, box[1].transform.localScale.z);
                    box[3].transform.localScale = box[1].transform.localScale;

                    //Position the top/bottom borders between the right/left borders.
                    box[1].transform.position += box[1].transform.right * (moveVector.x / 2);
                    box[3].transform.position += box[3].transform.right * (moveVector.x / 2);
                }
            }
            else if (gameObject.tag == "Down")
            {
                if ((gameObject.transform.position + gameObject.transform.up * moveVector.y).y <= minY || (gameObject.transform.position + gameObject.transform.up * moveVector.y).y < gameObject.transform.position.y)
                {
                    //Move the border down.
                    gameObject.transform.position += gameObject.transform.up * moveVector.y;

                    //Get the distance between the top and bottom border, then scale properly the right/left borders.
                    val = Vector3.Distance(gameObject.transform.position, box[1].transform.position);
                    box[0].transform.localScale = new Vector3(box[0].transform.localScale.x, val + (1 * 0.02f), box[0].transform.localScale.z);
                    box[2].transform.localScale = box[0].transform.localScale;

                    //Position the right/left borders between the top/bottom borders.
                    box[0].transform.position += box[0].transform.up * (moveVector.y / 2);
                    box[2].transform.position += box[2].transform.up * (moveVector.y / 2);
                }
            }
        }
    }
Exemplo n.º 22
0
 public void OnManipulationCompleted(ManipulationEventData eventData) => _text.text = "OnManipulationCompleted";
Exemplo n.º 23
0
 public void OnManipulationUpdated(ManipulationEventData eventData)
 {
     Delta = eventData.CumulativeDelta;
 }
Exemplo n.º 24
0
 public void OnManipulationStarted(ManipulationEventData eventData)
 {
     previousPosition = eventData.CumulativeDelta;
 }
Exemplo n.º 25
0
 public void OnManipulationCanceled(ManipulationEventData eventData)
 {
     this.Done();
 }
Exemplo n.º 26
0
 public void OnManipulationStarted(ManipulationEventData eventData)
 {
     InputManager.Instance.PushModalInputHandler(gameObject);
     lastScale = transform.localScale;
 }
 public void OnManipulationEnded(ManipulationEventData data)
 {
     isManipulate = false;
 }
Exemplo n.º 28
0
 public void OnManipulationCanceled(ManipulationEventData eventData)
 {
     InputManager.Instance.PopModalInputHandler();
 }
Exemplo n.º 29
0
 public void OnManipulationUpdated(ManipulationEventData eventData)
 {
 }
Exemplo n.º 30
0
 void IManipulationHandler.OnManipulationCompleted(ManipulationEventData eventData)
 {
     InputManager.Instance.PopModalInputHandler();
     gameObject.GetComponent <SpriteRenderer>().color  = oldColor;
     gameObject.GetComponent <SpriteRenderer>().sprite = oldSprite;
 }
Exemplo n.º 31
0
 protected virtual void ManipulationStarted(GameObject obj, ManipulationEventData eventData)
 {
 }
Exemplo n.º 32
0
 void IManipulationHandler.OnManipulationStarted(ManipulationEventData eventData)
 {
     gameObject.GetComponent <SpriteRenderer>().color = newColor;
     InputManager.Instance.PushModalInputHandler(gameObject); //this makes sure we get the manipulation data even if the gaze is not on our gameobject
 }