Пример #1
0
 SteamVR_Action_Vector2.ChangeHandler CreateDoubleAxisHandler(DoubleAxis doubleAxis, SingleAxis singleX, SingleAxis singleY)
 {
     return((SteamVR_Action_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 axis, Vector2 delta) => {
         var x = Mathf.Round(axis.x * 100) / 100;
         var y = Mathf.Round(axis.y * 100) / 100;
         _doubleAxes[doubleAxis] = new Vector2(x, y);
         _singleAxes[singleX.GetInputAxisName(0)] = x;
         _singleAxes[singleY.GetInputAxisName(0)] = y;
     });
 }
Пример #2
0
        internal void RemoveAxis(DoubleAxis axis)
        {
            if (!_doubleAxes.Contains(axis))
                throw new Exception("Axes group does not contain axis.");

            _doubleAxes.Remove(axis);
            // TODO: Event abhängen (siehe unten)
            //axis.BoundsChanged -= axis_BoundsChanged;
            OnAxesChanged();
        }
Пример #3
0
        internal void AddAxis(DoubleAxis axis)
        {
            if (ProxyAxis.GroupingMatches(axis, AxisMatchingMode.UomOnly).NotAllowed && !IsRelative)
                throw new Exception("The scales cannot be grouped because they don't match.");

            SyncScale(axis);
            _doubleAxes.Add(axis);
            axis.BoundsChanged += (s, e) => axis_BoundsChanged(axis);
            OnAxesChanged();
        }