Пример #1
0
        static UnityInputEditor()
        {
            UnityInputTransform axes = AssetDatabase.LoadAssetAtPath <UnityInputTransform>("Assets/Ximmerse SDK/Extensions/UnityInput/Others/Unity-Gamepad.asset");

            if (axes == null)
            {
                axes = AssetDatabase.LoadAssetAtPath <UnityInputTransform>("Assets/Ximmerse SDK Ext/Extensions/UnityInput/Others/Unity-Gamepad.asset");
            }
            if (axes != null)
            {
                BindAxes(axes);
            }
        }
Пример #2
0
        // Taken from OVR/Moonlight/Editor/OVRMoonlightLoader.cs--》


        public static void BindAxes(UnityInputTransform axes)
        {
            if (axes == null)
            {
                return;
            }
            //
            BindAxis(axes.LeftThumbstickX);
            BindAxis(axes.LeftThumbstickY);
            BindAxis(axes.RightThumbstickX);
            BindAxis(axes.RightThumbstickY);
            BindAxis(axes.LeftTrigger);
            BindAxis(axes.RightTrigger);
            //
            BindAxis(axes.DpadX);
            BindAxis(axes.DpadY);
        }
Пример #3
0
 public UnityController(string name, UnityInputTransform transform) : base(name)
 {
     this.transform = transform;
     // TODO :
     if (ControllerInputManager.s_ControllerDatabase == null)
     {
         ControllerInputManager.s_ControllerDatabase = new Dictionary <string, ControllerInputManager.ControllerInfo>();
     }
     ControllerInputManager.ControllerInfo info;
     if (ControllerInputManager.s_ControllerDatabase.TryGetValue(name, out info))
     {
     }
     else
     {
         info = new ControllerInputManager.ControllerInfo();
         ControllerInputManager.s_ControllerDatabase.Add(name, info);
     }
     info.type     = this.transform.type;
     info.priority = this.transform.priority;
 }