AttachToAdjacent() public static method

public static AttachToAdjacent ( ) : void
return void
コード例 #1
0
    IEnumerator attach()
    {
        //if (!MyoManager.GetIsAttached())
        //{
        //    MyoManager.AttachToAdjacent();
        //    yield return new WaitForSeconds(2);
        //    if (!MyoManager.GetIsAttached())
        //    {
        //        MyoManager.AttachToAdjacent();
        //        yield return new WaitForSeconds(2);
        //        if (!MyoManager.GetIsAttached())
        //        {
        //            MyoManager.AttachToAdjacent();
        //            yield return new WaitForSeconds(2);
        //            if (!MyoManager.GetIsAttached())
        //            {
        //                MyoManager.AttachToAdjacent();

        //            }

        //        }

        //    }
        //}
        yield return(new WaitForSeconds(5));

        MyoManager.AttachToAdjacent();
    }
コード例 #2
0
    void OnGUI()
    {
        GUI.BeginGroup(new Rect(10, 10, 300, 500));

        if (GUILayout.Button("Present Pairing", GUILayout.MinWidth(300), GUILayout.MinHeight(50)))
        {
            MyoManager.PresentPairing();
        }

        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);
        }

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

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

        GUI.EndGroup();
    }
コード例 #3
0
 void Update()
 {
     if (MyoManager.GetIsAttached())
     {
         myoRotation             = MyoManager.GetQuaternion();
         objectToRotate.rotation = myoRotation;
     }
     else
     {
         MyoManager.AttachToAdjacent();
     }
 }
コード例 #4
0
ファイル: MyoPluginDemo.cs プロジェクト: jphacks/SP_1711
    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();
    }