コード例 #1
0
 // Update is called once per frame
 private void Update()
 {
     for (i = 0; i < 8; i++)
     {
         VirtualInput vi;
         int          id = UNInput.GetInputIndex("Hardware Joystick " + i.ToString());
         if (UNInput.GetInputReference(id, out vi))
         {
             if (vi.connected)
             {
                 if (gamepadType == GamepadType.AndroidGamepad)
                 {
                     /*if (((NetworkInput)vi)) //Checar se é Mobile
                      * {
                      *  Axes(id);
                      *  Buttons(id);
                      * }*/
                 }
                 else if (gamepadType == GamepadType.XBoxGamepad)
                 {
                     if (((HardwareInput)vi).type == HardwareInput.HardwareType.Xbox)
                     {
                         Axes(id, xbox);
                         Buttons(id, xbox);
                     }
                 }
                 else if (gamepadType == GamepadType.PlayStationGamepad)
                 {
                     if (((HardwareInput)vi).type == HardwareInput.HardwareType.Playstation)
                     {
                         Axes(id, playstation);
                         Buttons(id, playstation);
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
 void Start()
 {
     input_id = UNInput.GetInputIndex("Network Control");
 }