unity 脚本把变量放一起,在界面上显示,同时鼠标靠近时有注释出现,变量是滑动条有区间

1, 相关的变量放一起,写提示注释。
 [Header("Action Alias Buttons")]

        [Tooltip("The button to use for the action of turning a laser pointer on / off.")]
        public ButtonAlias pointerToggleButton = ButtonAlias.Touchpad_Press;
        [Tooltip("The button to use for the action of setting a destination marker from the cursor position of the pointer.")]
        public ButtonAlias pointerSetButton = ButtonAlias.Touchpad_Press;
        [Tooltip("The button to use for the action of grabbing game objects.")]
        public ButtonAlias grabToggleButton = ButtonAlias.Grip_Press;
        [Tooltip("The button to use for the action of using game objects.")]
        public ButtonAlias useToggleButton = ButtonAlias.Trigger_Press;
        [Tooltip("The button to use for the action of clicking a UI element.")]
        public ButtonAlias uiClickButton = ButtonAlias.Trigger_Press;
        [Tooltip("The button to use for the action of bringing up an in-game menu.")]
        public ButtonAlias menuToggleButton = ButtonAlias.Button_One_Press;



        [Header("Axis Refinement")]

        [Tooltip("The amount of fidelity in the changes on the axis, which is defaulted to 1. Any number higher than 2 will probably give too sensitive results.")]
        public int axisFidelity = 1;
        [Tooltip("The level on the trigger axis to reach before a click is registered.")]
        public float triggerClickThreshold = 1f;
        [Tooltip("The level on the grip axis to reach before a click is registered.")]
        public float gripClickThreshold = 1f;

        /// <summary>
        /// This will be true if the trigger is squeezed about half way in.
        /// </summary>
        [HideInInspector]
        public bool triggerPressed = false;
        /// <summary>
        /// This will be true if the trigger is squeezed a small amount.
        /// </summary>
        [HideInInspector]
        public bool triggerTouched = false;
  
      


2,变量设置为区间值,滑动条的样式。



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值