File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,14 @@ public static float devicePixelRatio
192
192
get ; set ;
193
193
}
194
194
195
+ /// <summary>
196
+ /// The scale of the mouse scroll delta.
197
+ /// </summary>
198
+ public static float mouseWheelScale
199
+ {
200
+ get ; set ;
201
+ }
202
+
195
203
/// <summary>
196
204
///
197
205
/// </summary>
@@ -231,6 +239,7 @@ public Stage() : base()
231
239
232
240
// 在PC上,是否retina屏对输入法位置,鼠标滚轮速度都有影响,但现在没发现Unity有获得的方式。仅判断是否Mac可能不够(外接显示器的情况)。所以最好自行设置。
233
241
devicePixelRatio = ( isOSX && Screen . dpi > 96 ) ? 2 : 1 ;
242
+ mouseWheelScale = 1 ;
234
243
235
244
_rollOutChain = new List < DisplayObject > ( ) ;
236
245
_rollOverChain = new List < DisplayObject > ( ) ;
@@ -976,7 +985,7 @@ internal void HandleGUIEvents(Event evt)
976
985
if ( _touchTarget != null )
977
986
{
978
987
TouchInfo touch = _touches [ 0 ] ;
979
- touch . mouseWheelDelta = evt . delta . y ;
988
+ touch . mouseWheelDelta = evt . delta . y * Stage . mouseWheelScale ;
980
989
touch . UpdateEvent ( ) ;
981
990
_touchTarget . BubbleEvent ( "onMouseWheel" , touch . evt ) ;
982
991
touch . mouseWheelDelta = 0 ;
You can’t perform that action at this time.
0 commit comments