示例#1
0
    private void FixedUpdate()
    {
        if (Keyboard)
        {
            if (Input.GetKey(KeyCode.Z) && !Input.GetKey(KeyCode.X))
            {
                if (msg.GetActualDevice() == COM.Device.Pen)
                {
                    scaleValue -= 10.0f;
                }
                else
                {
                    scaleValue -= 10.0f;
                }
            }
            else if (Input.GetKey(KeyCode.X) && !Input.GetKey(KeyCode.Z))
            {
                if (msg.GetActualDevice() == COM.Device.Pen)
                {
                    scaleValue += 10.0f;
                }
                else
                {
                    scaleValue += 10.0f;
                }
            }

            if (Input.GetKey(KeyCode.Z) && Input.GetKey(KeyCode.X))
            {
                x = y = z = a1 = a2 = a3 = 0;
            }
        }
    }
示例#2
0
 void FixedUpdate()
 {
     if (msg.GetActualDevice() == COM.Device.Pen)
     {
         x.text  = "X: " + msg.LoadDeltas().x.ToString();
         y.text  = "Y: " + msg.LoadDeltas().y.ToString();
         a1.text = "Z: " + msg.LoadDeltas().z.ToString();
         a2.text = "DeltaX:: " + msg.LoadDeltas().x.ToString();
         a3.text = "button: " + msg.result[6];
     }
     else
     {
         x.text  = "X: " + msg.LoadPositions().x.ToString();
         y.text  = "Y: " + msg.LoadPositions().y.ToString();
         a1.text = "A1: " + msg.LoadAngles().x.ToString();
         a2.text = "A2: " + msg.LoadAngles().y.ToString();
         a3.text = "button: " + msg.ButtonPressed(0).ToString();
     }
 }