Esempio n. 1
0
    void MyTransformGesture_Transformed(object sender, System.EventArgs e)
    {
        myTransformGesture.ApplyTransform(this.transform);

        if (this.transform.localScale.sqrMagnitude > maxScaling.sqrMagnitude)
        {
            Debug.Log("we are too big");
            this.transform.localScale = maxScaling;
        }
        if (this.transform.localScale.sqrMagnitude < minScaling.sqrMagnitude)
        {
            Debug.Log("we are too small, our min magnitude is: " + minScaling.sqrMagnitude.ToString() + ", when we are this big: " + this.transform.localScale.sqrMagnitude.ToString());
            this.transform.localScale = minScaling;
        }

        //Debug.LogError (myTransformGesture.ScreenPosition);
        //Debug.LogError(Camera.main.ScreenToWorldPoint(new Vector3(myTransformGesture.ScreenPosition.x, myTransformGesture.ScreenPosition.y, Camera.main.farClipPlane)));
        if (m_DraggingIcon != null)
        {
            SetDraggedPosition(myTransformGesture.ScreenPosition);
        }
    }
Esempio n. 2
0
        private void transformHandler(object sender, EventArgs e)
        {
            TransformGesture gesture = sender as TransformGesture;

            gesture.ApplyTransform(transform);
        }