StandaloneInputModule2.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. using System;
  2. using UnityEngine.Serialization;
  3. namespace UnityEngine.EventSystems
  4. {
  5. [AddComponentMenu("Event/Standalone Input Module2")]
  6. public class StandaloneInputModule2 : PointerInputModule
  7. {
  8. protected StandaloneInputModule2()
  9. {
  10. }
  11. [Obsolete("Mode is no longer needed on input module as it handles both mouse and keyboard simultaneously.", false)]
  12. public StandaloneInputModule2.InputMode inputMode
  13. {
  14. get
  15. {
  16. return StandaloneInputModule2.InputMode.Mouse;
  17. }
  18. }
  19. [Obsolete("allowActivationOnMobileDevice has been deprecated. Use forceModuleActive instead (UnityUpgradable) -> forceModuleActive")]
  20. public bool allowActivationOnMobileDevice
  21. {
  22. get
  23. {
  24. return this.m_ForceModuleActive;
  25. }
  26. set
  27. {
  28. this.m_ForceModuleActive = value;
  29. }
  30. }
  31. public bool forceModuleActive
  32. {
  33. get
  34. {
  35. return this.m_ForceModuleActive;
  36. }
  37. set
  38. {
  39. this.m_ForceModuleActive = value;
  40. }
  41. }
  42. public float inputActionsPerSecond
  43. {
  44. get
  45. {
  46. return this.m_InputActionsPerSecond;
  47. }
  48. set
  49. {
  50. this.m_InputActionsPerSecond = value;
  51. }
  52. }
  53. public float repeatDelay
  54. {
  55. get
  56. {
  57. return this.m_RepeatDelay;
  58. }
  59. set
  60. {
  61. this.m_RepeatDelay = value;
  62. }
  63. }
  64. public string horizontalAxis
  65. {
  66. get
  67. {
  68. return this.m_HorizontalAxis;
  69. }
  70. set
  71. {
  72. this.m_HorizontalAxis = value;
  73. }
  74. }
  75. public string verticalAxis
  76. {
  77. get
  78. {
  79. return this.m_VerticalAxis;
  80. }
  81. set
  82. {
  83. this.m_VerticalAxis = value;
  84. }
  85. }
  86. public string submitButton
  87. {
  88. get
  89. {
  90. return this.m_SubmitButton;
  91. }
  92. set
  93. {
  94. this.m_SubmitButton = value;
  95. }
  96. }
  97. public string cancelButton
  98. {
  99. get
  100. {
  101. return this.m_CancelButton;
  102. }
  103. set
  104. {
  105. this.m_CancelButton = value;
  106. }
  107. }
  108. public override void UpdateModule()
  109. {
  110. this.m_LastMousePosition = this.m_MousePosition;
  111. this.m_MousePosition = base.input.mousePosition;
  112. }
  113. public override bool IsModuleSupported()
  114. {
  115. return this.m_ForceModuleActive || base.input.mousePresent || base.input.touchSupported;
  116. }
  117. public override bool ShouldActivateModule()
  118. {
  119. if (!base.ShouldActivateModule())
  120. {
  121. return false;
  122. }
  123. bool flag = this.m_ForceModuleActive;
  124. flag |= base.input.GetButtonDown(this.m_SubmitButton);
  125. flag |= base.input.GetButtonDown(this.m_CancelButton);
  126. flag |= !Mathf.Approximately(base.input.GetAxisRaw(this.m_HorizontalAxis), 0f);
  127. flag |= !Mathf.Approximately(base.input.GetAxisRaw(this.m_VerticalAxis), 0f);
  128. flag |= ((this.m_MousePosition - this.m_LastMousePosition).sqrMagnitude > 0f);
  129. flag |= base.input.GetMouseButtonDown(0);
  130. if (base.input.touchCount > 0)
  131. {
  132. flag = true;
  133. }
  134. return flag;
  135. }
  136. public override void ActivateModule()
  137. {
  138. base.ActivateModule();
  139. this.m_InputOverride = base.GetComponent<BaseInput2>();
  140. if (this.m_InputOverride == null)
  141. {
  142. this.m_InputOverride = base.gameObject.AddComponent<BaseInput2>();
  143. }
  144. this.m_MousePosition = base.input.mousePosition;
  145. this.m_LastMousePosition = this.m_MousePosition;
  146. GameObject gameObject = base.eventSystem.currentSelectedGameObject;
  147. if (gameObject == null)
  148. {
  149. gameObject = base.eventSystem.firstSelectedGameObject;
  150. }
  151. base.eventSystem.SetSelectedGameObject(gameObject, this.GetBaseEventData());
  152. }
  153. public override void DeactivateModule()
  154. {
  155. base.DeactivateModule();
  156. base.ClearSelection();
  157. }
  158. public override void Process()
  159. {
  160. bool flag = this.SendUpdateEventToSelectedObject();
  161. if (base.eventSystem.sendNavigationEvents)
  162. {
  163. if (!flag)
  164. {
  165. flag |= this.SendMoveEventToSelectedObject();
  166. }
  167. if (!flag)
  168. {
  169. this.SendSubmitEventToSelectedObject();
  170. }
  171. }
  172. if (!this.ProcessTouchEvents() && base.input.mousePresent)
  173. {
  174. this.ProcessMouseEvent();
  175. }
  176. }
  177. private bool ProcessTouchEvents()
  178. {
  179. for (int i = 0; i < base.input.touchCount; i++)
  180. {
  181. Touch touch = base.input.GetTouch(i);
  182. if (touch.type != TouchType.Indirect)
  183. {
  184. bool pressed;
  185. bool flag;
  186. PointerEventData touchPointerEventData = base.GetTouchPointerEventData(touch, out pressed, out flag);
  187. this.ProcessTouchPress(touchPointerEventData, pressed, flag);
  188. if (!flag)
  189. {
  190. this.ProcessMove(touchPointerEventData);
  191. this.ProcessDrag(touchPointerEventData);
  192. }
  193. else
  194. {
  195. base.RemovePointerData(touchPointerEventData);
  196. }
  197. }
  198. }
  199. return base.input.touchCount > 0;
  200. }
  201. protected void ProcessTouchPress(PointerEventData pointerEvent, bool pressed, bool released)
  202. {
  203. GameObject gameObject = pointerEvent.pointerCurrentRaycast.gameObject;
  204. if (pressed)
  205. {
  206. pointerEvent.eligibleForClick = true;
  207. pointerEvent.delta = Vector2.zero;
  208. pointerEvent.dragging = false;
  209. pointerEvent.useDragThreshold = true;
  210. pointerEvent.pressPosition = pointerEvent.position;
  211. pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast;
  212. base.DeselectIfSelectionChanged(gameObject, pointerEvent);
  213. if (pointerEvent.pointerEnter != gameObject)
  214. {
  215. base.HandlePointerExitAndEnter(pointerEvent, gameObject);
  216. pointerEvent.pointerEnter = gameObject;
  217. }
  218. GameObject gameObject2 = ExecuteEvents.ExecuteHierarchy<IPointerDownHandler>(gameObject, pointerEvent, ExecuteEvents.pointerDownHandler);
  219. if (gameObject2 == null)
  220. {
  221. gameObject2 = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  222. }
  223. float unscaledTime = Time.unscaledTime;
  224. if (gameObject2 == pointerEvent.lastPress)
  225. {
  226. float num = unscaledTime - pointerEvent.clickTime;
  227. if (num < 0.3f)
  228. {
  229. pointerEvent.clickCount++;
  230. }
  231. else
  232. {
  233. pointerEvent.clickCount = 1;
  234. }
  235. pointerEvent.clickTime = unscaledTime;
  236. }
  237. else
  238. {
  239. pointerEvent.clickCount = 1;
  240. }
  241. pointerEvent.pointerPress = gameObject2;
  242. pointerEvent.rawPointerPress = gameObject;
  243. pointerEvent.clickTime = unscaledTime;
  244. pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
  245. if (pointerEvent.pointerDrag != null)
  246. {
  247. ExecuteEvents.Execute<IInitializePotentialDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag);
  248. }
  249. }
  250. if (released)
  251. {
  252. ExecuteEvents.Execute<IPointerUpHandler>(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
  253. GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  254. if (pointerEvent.pointerPress == eventHandler && pointerEvent.eligibleForClick)
  255. {
  256. ExecuteEvents.Execute<IPointerClickHandler>(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler);
  257. }
  258. else if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
  259. {
  260. ExecuteEvents.ExecuteHierarchy<IDropHandler>(gameObject, pointerEvent, ExecuteEvents.dropHandler);
  261. }
  262. pointerEvent.eligibleForClick = false;
  263. pointerEvent.pointerPress = null;
  264. pointerEvent.rawPointerPress = null;
  265. if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
  266. {
  267. ExecuteEvents.Execute<IEndDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
  268. }
  269. pointerEvent.dragging = false;
  270. pointerEvent.pointerDrag = null;
  271. if (pointerEvent.pointerDrag != null)
  272. {
  273. ExecuteEvents.Execute<IEndDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
  274. }
  275. pointerEvent.pointerDrag = null;
  276. ExecuteEvents.ExecuteHierarchy<IPointerExitHandler>(pointerEvent.pointerEnter, pointerEvent, ExecuteEvents.pointerExitHandler);
  277. pointerEvent.pointerEnter = null;
  278. }
  279. }
  280. protected bool SendSubmitEventToSelectedObject()
  281. {
  282. return base.eventSystem.currentSelectedGameObject == null && false;
  283. }
  284. private Vector2 GetRawMoveVector()
  285. {
  286. Vector2 zero = Vector2.zero;
  287. zero.x = base.input.GetAxisRaw(this.m_HorizontalAxis);
  288. zero.y = base.input.GetAxisRaw(this.m_VerticalAxis);
  289. if (base.input.GetButtonDown(this.m_HorizontalAxis))
  290. {
  291. if (zero.x < 0f)
  292. {
  293. zero.x = -1f;
  294. }
  295. if (zero.x > 0f)
  296. {
  297. zero.x = 1f;
  298. }
  299. }
  300. if (base.input.GetButtonDown(this.m_VerticalAxis))
  301. {
  302. if (zero.y < 0f)
  303. {
  304. zero.y = -1f;
  305. }
  306. if (zero.y > 0f)
  307. {
  308. zero.y = 1f;
  309. }
  310. }
  311. return zero;
  312. }
  313. protected bool SendMoveEventToSelectedObject()
  314. {
  315. float unscaledTime = Time.unscaledTime;
  316. Vector2 rawMoveVector = this.GetRawMoveVector();
  317. if (Mathf.Approximately(rawMoveVector.x, 0f) && Mathf.Approximately(rawMoveVector.y, 0f))
  318. {
  319. this.m_ConsecutiveMoveCount = 0;
  320. return false;
  321. }
  322. bool flag = base.input.GetButtonDown(this.m_HorizontalAxis) || base.input.GetButtonDown(this.m_VerticalAxis);
  323. bool flag2 = Vector2.Dot(rawMoveVector, this.m_LastMoveVector) > 0f;
  324. if (!flag)
  325. {
  326. if (flag2 && this.m_ConsecutiveMoveCount == 1)
  327. {
  328. flag = (unscaledTime > this.m_PrevActionTime + this.m_RepeatDelay);
  329. }
  330. else
  331. {
  332. flag = (unscaledTime > this.m_PrevActionTime + 1f / this.m_InputActionsPerSecond);
  333. }
  334. }
  335. if (!flag)
  336. {
  337. return false;
  338. }
  339. AxisEventData axisEventData = this.GetAxisEventData(rawMoveVector.x, rawMoveVector.y, 0.6f);
  340. if (axisEventData.moveDir != MoveDirection.None)
  341. {
  342. ExecuteEvents.Execute<IMoveHandler>(base.eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler);
  343. if (!flag2)
  344. {
  345. this.m_ConsecutiveMoveCount = 0;
  346. }
  347. this.m_ConsecutiveMoveCount++;
  348. this.m_PrevActionTime = unscaledTime;
  349. this.m_LastMoveVector = rawMoveVector;
  350. }
  351. else
  352. {
  353. this.m_ConsecutiveMoveCount = 0;
  354. }
  355. return axisEventData.used;
  356. }
  357. protected void ProcessMouseEvent()
  358. {
  359. this.ProcessMouseEvent(0);
  360. }
  361. [Obsolete("This method is no longer checked, overriding it with return true does nothing!")]
  362. protected virtual bool ForceAutoSelect()
  363. {
  364. return false;
  365. }
  366. protected override PointerInputModule.MouseState GetMousePointerEventData(int id)
  367. {
  368. PointerEventData pointerEventData;
  369. bool pointerData = base.GetPointerData(-1, out pointerEventData, true);
  370. pointerEventData.Reset();
  371. if (pointerData)
  372. {
  373. pointerEventData.position = this.m_MousePosition;
  374. }
  375. Vector2 mousePosition = this.m_MousePosition;
  376. pointerEventData.delta = mousePosition - pointerEventData.position;
  377. pointerEventData.position = mousePosition;
  378. pointerEventData.scrollDelta = base.input.mouseScrollDelta;
  379. pointerEventData.button = PointerEventData.InputButton.Left;
  380. base.eventSystem.RaycastAll(pointerEventData, this.m_RaycastResultCache);
  381. RaycastResult pointerCurrentRaycast = BaseInputModule.FindFirstRaycast(this.m_RaycastResultCache);
  382. pointerEventData.pointerCurrentRaycast = pointerCurrentRaycast;
  383. this.m_RaycastResultCache.Clear();
  384. PointerEventData pointerEventData2;
  385. base.GetPointerData(-2, out pointerEventData2, true);
  386. base.CopyFromTo(pointerEventData, pointerEventData2);
  387. pointerEventData2.button = PointerEventData.InputButton.Right;
  388. PointerEventData pointerEventData3;
  389. base.GetPointerData(-3, out pointerEventData3, true);
  390. base.CopyFromTo(pointerEventData, pointerEventData3);
  391. pointerEventData3.button = PointerEventData.InputButton.Middle;
  392. this.m_MouseState.SetButtonState(PointerEventData.InputButton.Left, base.StateForMouseButton(0), pointerEventData);
  393. this.m_MouseState.SetButtonState(PointerEventData.InputButton.Right, base.StateForMouseButton(1), pointerEventData2);
  394. this.m_MouseState.SetButtonState(PointerEventData.InputButton.Middle, base.StateForMouseButton(2), pointerEventData3);
  395. return this.m_MouseState;
  396. }
  397. private static bool ShouldStartDrag(Vector2 pressPos, Vector2 currentPos, float threshold, bool useDragThreshold)
  398. {
  399. return !useDragThreshold || (pressPos - currentPos).sqrMagnitude >= threshold * threshold;
  400. }
  401. protected override void ProcessMove(PointerEventData pointerEvent)
  402. {
  403. GameObject gameObject = pointerEvent.pointerCurrentRaycast.gameObject;
  404. base.HandlePointerExitAndEnter(pointerEvent, gameObject);
  405. }
  406. protected override void ProcessDrag(PointerEventData pointerEvent)
  407. {
  408. if (!pointerEvent.IsPointerMoving() || pointerEvent.pointerDrag == null)
  409. {
  410. return;
  411. }
  412. if (!pointerEvent.dragging && StandaloneInputModule2.ShouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, (float)base.eventSystem.pixelDragThreshold, pointerEvent.useDragThreshold))
  413. {
  414. ExecuteEvents.Execute<IBeginDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler);
  415. pointerEvent.dragging = true;
  416. }
  417. if (pointerEvent.dragging)
  418. {
  419. if (pointerEvent.pointerPress != pointerEvent.pointerDrag)
  420. {
  421. ExecuteEvents.Execute<IPointerUpHandler>(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
  422. pointerEvent.eligibleForClick = false;
  423. pointerEvent.pointerPress = null;
  424. pointerEvent.rawPointerPress = null;
  425. }
  426. ExecuteEvents.Execute<IDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler);
  427. }
  428. }
  429. protected void ProcessMouseEvent(int id)
  430. {
  431. PointerInputModule.MouseState mousePointerEventData = this.GetMousePointerEventData(id);
  432. PointerInputModule.MouseButtonEventData eventData = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
  433. this.m_CurrentFocusedGameObject = eventData.buttonData.pointerCurrentRaycast.gameObject;
  434. this.ProcessMousePress(eventData);
  435. this.ProcessMove(eventData.buttonData);
  436. this.ProcessDrag(eventData.buttonData);
  437. this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData);
  438. this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData);
  439. this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData);
  440. this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData);
  441. if (!Mathf.Approximately(eventData.buttonData.scrollDelta.sqrMagnitude, 0f))
  442. {
  443. GameObject eventHandler = ExecuteEvents.GetEventHandler<IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject);
  444. ExecuteEvents.ExecuteHierarchy<IScrollHandler>(eventHandler, eventData.buttonData, ExecuteEvents.scrollHandler);
  445. }
  446. }
  447. protected bool SendUpdateEventToSelectedObject()
  448. {
  449. if (base.eventSystem.currentSelectedGameObject == null)
  450. {
  451. return false;
  452. }
  453. BaseEventData baseEventData = this.GetBaseEventData();
  454. ExecuteEvents.Execute<IUpdateSelectedHandler>(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.updateSelectedHandler);
  455. return baseEventData.used;
  456. }
  457. protected void ProcessMousePress(PointerInputModule.MouseButtonEventData data)
  458. {
  459. PointerEventData buttonData = data.buttonData;
  460. GameObject gameObject = buttonData.pointerCurrentRaycast.gameObject;
  461. if (data.PressedThisFrame())
  462. {
  463. buttonData.eligibleForClick = true;
  464. buttonData.delta = Vector2.zero;
  465. buttonData.dragging = false;
  466. buttonData.useDragThreshold = true;
  467. buttonData.pressPosition = buttonData.position;
  468. buttonData.pointerPressRaycast = buttonData.pointerCurrentRaycast;
  469. base.DeselectIfSelectionChanged(gameObject, buttonData);
  470. GameObject gameObject2 = ExecuteEvents.ExecuteHierarchy<IPointerDownHandler>(gameObject, buttonData, ExecuteEvents.pointerDownHandler);
  471. if (gameObject2 == null)
  472. {
  473. gameObject2 = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  474. }
  475. float unscaledTime = Time.unscaledTime;
  476. if (gameObject2 == buttonData.lastPress)
  477. {
  478. float num = unscaledTime - buttonData.clickTime;
  479. if (num < 0.3f)
  480. {
  481. buttonData.clickCount++;
  482. }
  483. else
  484. {
  485. buttonData.clickCount = 1;
  486. }
  487. buttonData.clickTime = unscaledTime;
  488. }
  489. else
  490. {
  491. buttonData.clickCount = 1;
  492. }
  493. buttonData.pointerPress = gameObject2;
  494. buttonData.rawPointerPress = gameObject;
  495. buttonData.clickTime = unscaledTime;
  496. buttonData.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
  497. if (buttonData.pointerDrag != null)
  498. {
  499. ExecuteEvents.Execute<IInitializePotentialDragHandler>(buttonData.pointerDrag, buttonData, ExecuteEvents.initializePotentialDrag);
  500. }
  501. }
  502. if (data.ReleasedThisFrame())
  503. {
  504. ExecuteEvents.Execute<IPointerUpHandler>(buttonData.pointerPress, buttonData, ExecuteEvents.pointerUpHandler);
  505. GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  506. if (buttonData.pointerPress == eventHandler && buttonData.eligibleForClick)
  507. {
  508. ExecuteEvents.Execute<IPointerClickHandler>(buttonData.pointerPress, buttonData, ExecuteEvents.pointerClickHandler);
  509. }
  510. else if (buttonData.pointerDrag != null && buttonData.dragging)
  511. {
  512. ExecuteEvents.ExecuteHierarchy<IDropHandler>(gameObject, buttonData, ExecuteEvents.dropHandler);
  513. }
  514. buttonData.eligibleForClick = false;
  515. buttonData.pointerPress = null;
  516. buttonData.rawPointerPress = null;
  517. if (buttonData.pointerDrag != null && buttonData.dragging)
  518. {
  519. ExecuteEvents.Execute<IEndDragHandler>(buttonData.pointerDrag, buttonData, ExecuteEvents.endDragHandler);
  520. }
  521. buttonData.dragging = false;
  522. buttonData.pointerDrag = null;
  523. if (gameObject != buttonData.pointerEnter)
  524. {
  525. base.HandlePointerExitAndEnter(buttonData, null);
  526. base.HandlePointerExitAndEnter(buttonData, gameObject);
  527. }
  528. }
  529. }
  530. protected GameObject GetCurrentFocusedGameObject()
  531. {
  532. return this.m_CurrentFocusedGameObject;
  533. }
  534. private float m_PrevActionTime;
  535. private Vector2 m_LastMoveVector;
  536. private int m_ConsecutiveMoveCount;
  537. private Vector2 m_LastMousePosition;
  538. private Vector2 m_MousePosition;
  539. private GameObject m_CurrentFocusedGameObject;
  540. [SerializeField]
  541. private string m_HorizontalAxis = "Horizontal";
  542. [SerializeField]
  543. private string m_VerticalAxis = "Vertical";
  544. [SerializeField]
  545. private string m_SubmitButton = "Submit";
  546. [SerializeField]
  547. private string m_CancelButton = "Cancel";
  548. [SerializeField]
  549. private float m_InputActionsPerSecond = 10f;
  550. [SerializeField]
  551. private float m_RepeatDelay = 0.5f;
  552. [SerializeField]
  553. [FormerlySerializedAs("m_AllowActivationOnMobileDevice")]
  554. private bool m_ForceModuleActive;
  555. private readonly PointerInputModule.MouseState m_MouseState = new PointerInputModule.MouseState();
  556. [Obsolete("Mode is no longer needed on input module as it handles both mouse and keyboard simultaneously.", false)]
  557. public enum InputMode
  558. {
  559. Mouse,
  560. Buttons
  561. }
  562. }
  563. }