GetIsAttached() public static method

public static GetIsAttached ( ) : bool
return bool
示例#1
0
 void Update()
 {
     if (MyoManager.GetIsAttached())
     {
         myoRotation             = MyoManager.GetQuaternion();
         objectToRotate.rotation = myoRotation;
     }
 }
 void Update()
 {
     if (MyoManager.GetIsAttached())
     {
         myoRotation             = MyoManager.GetQuaternion();
         objectToRotate.rotation = myoRotation;
     }
     else
     {
         MyoManager.AttachToAdjacent();
     }
 }
示例#3
0
    void OnGUI()
    {
        GUI.BeginGroup(new Rect(10, 10, 300, 500));

        if (GUILayout.Button("Attach to Adjacent", GUILayout.MinWidth(300), GUILayout.MinHeight(50)))
        {
            MyoManager.AttachToAdjacent();
        }

        if (GUILayout.Button("Vibrate Short", GUILayout.MinWidth(300), GUILayout.MinHeight(50)))
        {
            MyoManager.VibrateForLength(MyoVibrateLength.SHORT);
        }

        if (GUILayout.Button("Vibrate Medium", GUILayout.MinWidth(300), GUILayout.MinHeight(50)))
        {
            MyoManager.VibrateForLength(MyoVibrateLength.MEDIUM);
        }

        if (GUILayout.Button("Vibrate Long", GUILayout.MinWidth(300), GUILayout.MinHeight(50)))
        {
            MyoManager.VibrateForLength(MyoVibrateLength.LONG);
        }

        if (!MyoManager.GetIsInitialized())
        {
            if (GUILayout.Button("Initialize MyoPlugin", GUILayout.MinWidth(300), GUILayout.MinHeight(50)))
            {
                MyoManager.Initialize();
            }
        }
        else
        {
            if (GUILayout.Button("Uninitialize MyoPlugin", GUILayout.MinWidth(300), GUILayout.MinHeight(50)))
            {
                MyoManager.Uninitialize();
            }
        }

        GUILayout.Label("Myo Quaternion: " + myoRotation.ToString(), GUILayout.MinWidth(300), GUILayout.MinHeight(30));

        GUILayout.Label("Myo Pose: " + myoPose.ToString(), GUILayout.MinWidth(300), GUILayout.MinHeight(30));

        GUILayout.Label("Initialized: " + MyoManager.GetIsInitialized(), GUILayout.MinWidth(300), GUILayout.MinHeight(30));

        GUILayout.Label("Attached: " + MyoManager.GetIsAttached(), GUILayout.MinWidth(300), GUILayout.MinHeight(30));

        GUI.EndGroup();
    }
 // Update is called once per frame
 void Update()
 {
     if (!MyoManager.GetIsAttached())
     {
     }
     else
     {
         if (myoPose != lastPose)
         {
             if (myoPose == MyoPose.DOUBLE_TAP)
             {
                 mainScript.TapControl();
                 locked   = !locked;
                 lastPose = myoPose;
             }
             if (myoPose == MyoPose.REST)
             {
                 lastPose = myoPose;
             }
             if (!locked)
             {
                 if (myoPose == MyoPose.FIST)
                 {
                     StartCoroutine("isFistHold");
                     lastPose = myoPose;
                 }
                 if (myoPose == MyoPose.FINGERS_SPREAD)
                 {
                     lastPose = myoPose;
                     mainScript.AbrirMenu();
                 }
                 if (myoPose == MyoPose.WAVE_OUT)
                 {
                     StartCoroutine("isWOHold");
                     lastPose = myoPose;
                 }
                 if (myoPose == MyoPose.WAVE_IN)
                 {
                     StartCoroutine("isWIHold");
                     lastPose = myoPose;
                 }
             }
         }
     }
 }