当前位置: 首页>>代码示例>>C#>>正文


C# MouseAxis类代码示例

本文整理汇总了C#中MouseAxis的典型用法代码示例。如果您正苦于以下问题:C# MouseAxis类的具体用法?C# MouseAxis怎么用?C# MouseAxis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MouseAxis类属于命名空间,在下文中一共展示了MouseAxis类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MouseInput

    /// <summary>
    /// Create a new instance of <see cref="MouseInput"/> that handles specified mouse button.
    /// </summary>
    /// <param name="button">Mouse button.</param>
    public MouseInput(MouseButton button)
    {
        if (button==MouseButton.None)
        {
            Debug.LogError("button can't be MouseButton.None");
        }

        mAxis   = MouseAxis.None;
        mButton = button;
    }
开发者ID:Gris87,项目名称:PingPong3D,代码行数:14,代码来源:MouseInput.cs

示例2: GetName

 public string GetName(MouseAxis.Axis axis)
 {
     switch (axis)
     {
         case MouseAxis.Axis.ScrollWheel:    return "ScrollWheel";
         case MouseAxis.Axis.MouseX:         return "Mouse X";
         case MouseAxis.Axis.MouseY:         return "Mouse Y";
     }
     return "None";
 }
开发者ID:3dAnon,项目名称:PoniGame,代码行数:10,代码来源:ControlNames.cs

示例3: MouseInput

    /// <summary>
    /// Create a new instance of <see cref="MouseInput"/> that handles specified mouse axis.
    /// </summary>
    /// <param name="axis">Mouse axis.</param>
    /// <param name="modifiers">Key modifiers.</param>
    public MouseInput(MouseAxis axis, KeyModifier modifiers = KeyModifier.NoModifier)
    {
        if (axis == MouseAxis.None)
        {
            Debug.LogError("axis can't be MouseAxis.None");
        }

        mAxis      = axis;
        mButton    = MouseButton.None;
        mModifiers = modifiers;

        mCachedToString = null;
    }
开发者ID:Gris87,项目名称:UnityEditorCommonAssets,代码行数:18,代码来源:MouseInput.cs

示例4: MouseMovementInputAction

 /// <summary>
 /// Constructs an InputAction which tracks relative mouse movement.
 /// </summary>
 /// <param name="playerIndex">The index of the player using this input.</param>
 /// <param name="buttonAction">What state the button should be in to activate.</param>
 /// <param name="axis">The axis of movement to be tracked.</param>
 /// <param name="sensitivity">
 /// How sensitive the mouse is.
 /// A sensitivity of 4.0 and movement of 2 pixels will have a Degree of 0.5.</param>
 /// <param name="deadZoneMin">The minimum Degree which will not be sensed.</param>
 /// <param name="deadZoneMax">The maximum Degree which will not be sensed.</param>
 public MouseMovementInputAction(
     PlayerIndex playerIndex,
     ButtonAction buttonAction,
     MouseAxis axis,
     float sensitivity,
     float deadZoneMin,
     float deadZoneMax)
     : base(playerIndex, buttonAction)
 {
     mMouseAxis = axis;
     mSensitivity = sensitivity;
     mDeadZoneMax = deadZoneMax;
     mDeadZoneMin = deadZoneMin;
     previousX = Microsoft.Xna.Framework.Input.Mouse.GetState().X;
     previousY = Microsoft.Xna.Framework.Input.Mouse.GetState().Y;
 }
开发者ID:thormme,项目名称:Chimera,代码行数:27,代码来源:MouseMovementInputAction.cs

示例5: MouseAxisSource

        public MouseAxisSource(MouseAxis axis)
        {
            this.axis = axis;

            switch (axis)
            {
                case MouseAxis.Horizontal:
                    axisName = "Mouse X";
                    description = "Mouse Horizontal";
                    break;

                case MouseAxis.Vertical:
                    axisName = "Mouse Y";
                    description = "Mouse Vertical";
                    break;

                default:
                    throw new Exception("Unexpected axis value.");
            }
        }
开发者ID:mattlazarte,项目名称:AscentUnityProject,代码行数:20,代码来源:MouseAxisSource.cs

示例6: SetKey

 /// <summary>
 /// Create new <see cref="KeyMapping"/> with specified name and inputs.
 /// </summary>
 /// <returns>Created KeyMapping.</returns>
 /// <param name="name">KeyMapping name.</param>
 /// <param name="primary">Primary input.</param>
 /// <param name="secondary">Secondary input.</param>
 /// <param name="third">Third input.</param>
 public static KeyMapping SetKey(string name, MouseAxis primary, KeyCode secondary, KeyCode third)
 {
     return SetKey(name, ArgToInput(primary), ArgToInput(secondary), ArgToInput(third));
 }
开发者ID:Gris87,项目名称:UnityEditorCommonAssets,代码行数:12,代码来源:InputControl.cs

示例7: AbsoluteMousePositionOutput

 public AbsoluteMousePositionOutput(MouseAxis axis = MouseAxis.X)
 {
     this.Axis = axis;
 }
开发者ID:jonathanhook,项目名称:SpontaneousControls,代码行数:4,代码来源:AbsoluteMousePositionOutput.cs

示例8: setKey

 /// <summary>
 /// Create new <see cref="KeyMapping"/> with specified name and inputs.
 /// </summary>
 /// <returns>Created KeyMapping.</returns>
 /// <param name="name">KeyMapping name.</param>
 /// <param name="primary">Primary input.</param>
 /// <param name="secondary">Secondary input.</param>
 /// <param name="third">Third input.</param>
 public static KeyMapping setKey(string name, CustomInput primary, KeyCode secondary, MouseAxis third)
 {
     return setKey(name, argToInput(primary), argToInput(secondary), argToInput(third));
 }
开发者ID:HaKDMoDz,项目名称:UnityEditor,代码行数:12,代码来源:InputControl.cs

示例9: SetUp

 protected void SetUp()
 {
     mouse = new FakeMouse();
     instance = new MouseAxis(mouse);
 }
开发者ID:himapo,项目名称:ccm,代码行数:5,代码来源:MouseAxisTest.cs

示例10: ArgToInput

 /// <summary>
 /// Convert argument to <see cref="CustomInput"/>.
 /// </summary>
 /// <returns>Converted CustomInput.</returns>
 /// <param name="arg">Some kind of argument.</param>
 private static CustomInput ArgToInput(MouseAxis arg)
 {
     return new MouseInput(arg);
 }
开发者ID:Gris87,项目名称:UnityEditorCommonAssets,代码行数:9,代码来源:InputControl.cs

示例11: RelateMapWithMouseAxis

        protected void RelateMapWithMouseAxis(Maps map, Dictionary<MouseAxis, HashSet<Maps>> mapsPerMouseAxis, MouseAxis axis)
        {
            if (!mapsPerMouseAxis.ContainsKey(axis))
                mapsPerMouseAxis.Add(axis, new HashSet<Maps>());

            mapsPerMouseAxis[axis].Add(map);
        }
开发者ID:mattlazarte,项目名称:AscentUnityProject,代码行数:7,代码来源:UIControlsWindow.cs


注:本文中的MouseAxis类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。