Ejemplo n.º 1
0
    public static IEnumerator HoldKey(KeyCode key)
    {
        InputBroker.SetKeyDown(key);
        yield return(new WaitForEndOfFrame());

        InputBroker.SetKey(key);
    }
Ejemplo n.º 2
0
 private void parsekeys(string name, ButtonState buttons)
 {
     InputBroker.SetKey(name + ":B", buttons.B);
     InputBroker.SetKey(name + ":A", buttons.A);
     InputBroker.SetKey(name + ":Up", buttons.Up);
     InputBroker.SetKey(name + ":Left", buttons.Left);
     InputBroker.SetKey(name + ":Down", buttons.Down);
     InputBroker.SetKey(name + ":Right", buttons.Right);
     InputBroker.SetKey(name + ":Minus", buttons.Minus);
     InputBroker.SetKey(name + ":Home", buttons.Home);
     InputBroker.SetKey(name + ":Plus", buttons.Plus);
     InputBroker.SetKey(name + ":One", buttons.One);
     InputBroker.SetKey(name + ":Two", buttons.Two);
 }
    // Store InputSimulator values in InputBroker
    void UpdateInputBroker()
    {
        // Update RiftDK1's Vicon
        InputBroker.SetPosition(RiftDK1Vicon, new Vector3(RiftDK1X, RiftDK1Y, RiftDK1Z));
        Quaternion OculusRiftQuaternion = Quaternion.Euler(RiftDK1P, RiftDK1H, RiftDK1R);

        InputBroker.SetRotation(RiftDK1Vicon, OculusRiftQuaternion);

        // Update RightGlove's Vicon
        InputBroker.SetPosition(RightGloveVicon, new Vector3(RightGloveX, RightGloveY, RightGloveZ));
        Quaternion RightGloveQuaternion = Quaternion.Euler(RightGloveP, RightGloveH, RightGloveR);

        InputBroker.SetRotation(RightGloveVicon, RightGloveQuaternion);

        // Update RightWiimote's Vicon
        InputBroker.SetPosition(RightWiimoteVicon, new Vector3(RightWiimoteX, RightWiimoteY, RightWiimoteZ));
        Quaternion RightWiimoteQuaternion = Quaternion.Euler(RightWiimoteP, RightWiimoteH, RightWiimoteR);

        InputBroker.SetRotation(RightWiimoteVicon, RightWiimoteQuaternion);

        // Update RightWiimote's Buttons
        InputBroker.SetKey(RightWiimoteName + ":Up", RightWiimoteUp);
        InputBroker.SetKey(RightWiimoteName + ":Down", RightWiimoteDown);
        InputBroker.SetKey(RightWiimoteName + ":Left", RightWiimoteLeft);
        InputBroker.SetKey(RightWiimoteName + ":Right", RightWiimoteRight);
        InputBroker.SetKey(RightWiimoteName + ":A", RightWiimoteA);
        InputBroker.SetKey(RightWiimoteName + ":B", RightWiimoteB);
        InputBroker.SetKey(RightWiimoteName + ":Minus", RightWiimoteMinus);
        InputBroker.SetKey(RightWiimoteName + ":Plus", RightWiimotePlus);
        InputBroker.SetKey(RightWiimoteName + ":One", RightWiimote1);
        InputBroker.SetKey(RightWiimoteName + ":Two", RightWiimote2);

        // Update LeftGlove's Vicon
        InputBroker.SetPosition(LeftGloveVicon, new Vector3(LeftGloveX, LeftGloveY, LeftGloveZ));
        Quaternion LeftGloveQuaternion = Quaternion.Euler(LeftGloveP, LeftGloveH, LeftGloveR);

        InputBroker.SetRotation(LeftGloveVicon, LeftGloveQuaternion);

        // Update LeftWiimote's Vicon
        InputBroker.SetPosition(LeftWiimoteVicon, new Vector3(LeftWiimoteX, LeftWiimoteY, LeftWiimoteZ));
        Quaternion LeftWiimoteQuaternion = Quaternion.Euler(LeftWiimoteP, LeftWiimoteH, LeftWiimoteR);

        InputBroker.SetRotation(LeftWiimoteVicon, LeftWiimoteQuaternion);

        // Update LeftWiimote's Buttons
        InputBroker.SetKey(LeftWiimoteName + ":Up", LeftWiimoteUp);
        InputBroker.SetKey(LeftWiimoteName + ":Down", LeftWiimoteDown);
        InputBroker.SetKey(LeftWiimoteName + ":Left", LeftWiimoteLeft);
        InputBroker.SetKey(LeftWiimoteName + ":Right", LeftWiimoteRight);
        InputBroker.SetKey(LeftWiimoteName + ":A", LeftWiimoteA);
        InputBroker.SetKey(LeftWiimoteName + ":B", LeftWiimoteB);
        InputBroker.SetKey(LeftWiimoteName + ":Minus", LeftWiimoteMinus);
        InputBroker.SetKey(LeftWiimoteName + ":Plus", LeftWiimotePlus);
        InputBroker.SetKey(LeftWiimoteName + ":One", LeftWiimote1);
        InputBroker.SetKey(LeftWiimoteName + ":Two", LeftWiimote2);

        // Update RightShoe's Vicon
        InputBroker.SetPosition(RightShoeVicon, new Vector3(RightShoeX, RightShoeY, RightShoeZ));
        Quaternion RightShoeQuaternion = Quaternion.Euler(RightShoeP, RightShoeH, RightShoeR);

        InputBroker.SetRotation(RightShoeVicon, RightShoeQuaternion);

        // Update LeftShoe's Vicon
        InputBroker.SetPosition(LeftShoeVicon, new Vector3(LeftShoeX, LeftShoeY, LeftShoeZ));
        Quaternion LeftShoeQuaternion = Quaternion.Euler(LeftShoeP, LeftShoeH, LeftShoeR);

        InputBroker.SetRotation(LeftShoeVicon, LeftShoeQuaternion);
    }