示例#1
0
 void OnGUI()
 {
     //Write out basic usage instructions
     GUILayout.Label("Welcome to InputPlus - Press Tab to cycle between Raw Data / Programmed Values / Off");
     GUILayout.Label("Press keys 1-9 to program corresponding controller. 0 and A for 10 and 11, respectively\n");
     if (InputPlus.GetProgrammingStatus())
     {
         GUI.DrawTexture(new Rect(360, 160, 160, 160), ControllerVarEnum_to_Texture(InputPlus.GetWaitingForControl()),
                         ScaleMode.ScaleToFit, true, 1.0f);
         GUILayout.Label("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" +
                         "Programming for " + InputPlus.GetControllerName(InputPlus.GetListeningFor()));
     } //Show image of the control InputPlus is waiting to program. Display the name of the controller.
 }     //OnGUI
示例#2
0
    }    //Start

    // Update is called once per frame
    void Update()
    {
        ListenForLearnRequest();        //Explained in declaration
        ListenForDisplayMode();         //Listen for 'Tab' to toggle InputPlus's on screen data

        if (InputPlus.GetProgrammingStatus())
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                InputPlus.CancelProgramming();
            }
        } //If the controller is receiving assignments the user can press 'Escape' to Cancel.
    }     //Update