StandaloneInputModule2.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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. if (GameMain.Instance.VRMode)
  140. {
  141. this.m_InputOverride = base.GetComponent<BaseInput2>();
  142. if (this.m_InputOverride == null)
  143. {
  144. this.m_InputOverride = base.gameObject.AddComponent<BaseInput2>();
  145. }
  146. }
  147. this.m_MousePosition = base.input.mousePosition;
  148. this.m_LastMousePosition = this.m_MousePosition;
  149. GameObject gameObject = base.eventSystem.currentSelectedGameObject;
  150. if (gameObject == null)
  151. {
  152. gameObject = base.eventSystem.firstSelectedGameObject;
  153. }
  154. base.eventSystem.SetSelectedGameObject(gameObject, this.GetBaseEventData());
  155. }
  156. public override void DeactivateModule()
  157. {
  158. base.DeactivateModule();
  159. base.ClearSelection();
  160. }
  161. public override void Process()
  162. {
  163. bool flag = this.SendUpdateEventToSelectedObject();
  164. if (base.eventSystem.sendNavigationEvents)
  165. {
  166. if (!flag)
  167. {
  168. flag |= this.SendMoveEventToSelectedObject();
  169. }
  170. if (!flag)
  171. {
  172. this.SendSubmitEventToSelectedObject();
  173. }
  174. }
  175. if (!this.ProcessTouchEvents() && base.input.mousePresent)
  176. {
  177. this.ProcessMouseEvent();
  178. }
  179. }
  180. private bool ProcessTouchEvents()
  181. {
  182. for (int i = 0; i < base.input.touchCount; i++)
  183. {
  184. Touch touch = base.input.GetTouch(i);
  185. if (touch.type != TouchType.Indirect)
  186. {
  187. bool pressed;
  188. bool flag;
  189. PointerEventData touchPointerEventData = base.GetTouchPointerEventData(touch, out pressed, out flag);
  190. this.ProcessTouchPress(touchPointerEventData, pressed, flag);
  191. if (!flag)
  192. {
  193. this.ProcessMove(touchPointerEventData);
  194. this.ProcessDrag(touchPointerEventData);
  195. }
  196. else
  197. {
  198. base.RemovePointerData(touchPointerEventData);
  199. }
  200. }
  201. }
  202. return base.input.touchCount > 0;
  203. }
  204. protected void ProcessTouchPress(PointerEventData pointerEvent, bool pressed, bool released)
  205. {
  206. GameObject gameObject = pointerEvent.pointerCurrentRaycast.gameObject;
  207. if (pressed)
  208. {
  209. pointerEvent.eligibleForClick = true;
  210. pointerEvent.delta = Vector2.zero;
  211. pointerEvent.dragging = false;
  212. pointerEvent.useDragThreshold = true;
  213. pointerEvent.pressPosition = pointerEvent.position;
  214. pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast;
  215. base.DeselectIfSelectionChanged(gameObject, pointerEvent);
  216. if (pointerEvent.pointerEnter != gameObject)
  217. {
  218. base.HandlePointerExitAndEnter(pointerEvent, gameObject);
  219. pointerEvent.pointerEnter = gameObject;
  220. }
  221. GameObject gameObject2 = ExecuteEvents.ExecuteHierarchy<IPointerDownHandler>(gameObject, pointerEvent, ExecuteEvents.pointerDownHandler);
  222. if (gameObject2 == null)
  223. {
  224. gameObject2 = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  225. }
  226. float unscaledTime = Time.unscaledTime;
  227. if (gameObject2 == pointerEvent.lastPress)
  228. {
  229. float num = unscaledTime - pointerEvent.clickTime;
  230. if (num < 0.3f)
  231. {
  232. pointerEvent.clickCount++;
  233. }
  234. else
  235. {
  236. pointerEvent.clickCount = 1;
  237. }
  238. pointerEvent.clickTime = unscaledTime;
  239. }
  240. else
  241. {
  242. pointerEvent.clickCount = 1;
  243. }
  244. pointerEvent.pointerPress = gameObject2;
  245. pointerEvent.rawPointerPress = gameObject;
  246. pointerEvent.clickTime = unscaledTime;
  247. pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
  248. if (pointerEvent.pointerDrag != null)
  249. {
  250. ExecuteEvents.Execute<IInitializePotentialDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag);
  251. }
  252. }
  253. if (released)
  254. {
  255. ExecuteEvents.Execute<IPointerUpHandler>(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
  256. GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  257. if (pointerEvent.pointerPress == eventHandler && pointerEvent.eligibleForClick)
  258. {
  259. ExecuteEvents.Execute<IPointerClickHandler>(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler);
  260. }
  261. else if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
  262. {
  263. ExecuteEvents.ExecuteHierarchy<IDropHandler>(gameObject, pointerEvent, ExecuteEvents.dropHandler);
  264. }
  265. pointerEvent.eligibleForClick = false;
  266. pointerEvent.pointerPress = null;
  267. pointerEvent.rawPointerPress = null;
  268. if (pointerEvent.pointerDrag != null && pointerEvent.dragging)
  269. {
  270. ExecuteEvents.Execute<IEndDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
  271. }
  272. pointerEvent.dragging = false;
  273. pointerEvent.pointerDrag = null;
  274. if (pointerEvent.pointerDrag != null)
  275. {
  276. ExecuteEvents.Execute<IEndDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
  277. }
  278. pointerEvent.pointerDrag = null;
  279. ExecuteEvents.ExecuteHierarchy<IPointerExitHandler>(pointerEvent.pointerEnter, pointerEvent, ExecuteEvents.pointerExitHandler);
  280. pointerEvent.pointerEnter = null;
  281. }
  282. }
  283. protected bool SendSubmitEventToSelectedObject()
  284. {
  285. return base.eventSystem.currentSelectedGameObject == null && false;
  286. }
  287. private Vector2 GetRawMoveVector()
  288. {
  289. Vector2 zero = Vector2.zero;
  290. zero.x = base.input.GetAxisRaw(this.m_HorizontalAxis);
  291. zero.y = base.input.GetAxisRaw(this.m_VerticalAxis);
  292. if (base.input.GetButtonDown(this.m_HorizontalAxis))
  293. {
  294. if (zero.x < 0f)
  295. {
  296. zero.x = -1f;
  297. }
  298. if (zero.x > 0f)
  299. {
  300. zero.x = 1f;
  301. }
  302. }
  303. if (base.input.GetButtonDown(this.m_VerticalAxis))
  304. {
  305. if (zero.y < 0f)
  306. {
  307. zero.y = -1f;
  308. }
  309. if (zero.y > 0f)
  310. {
  311. zero.y = 1f;
  312. }
  313. }
  314. return zero;
  315. }
  316. protected bool SendMoveEventToSelectedObject()
  317. {
  318. float unscaledTime = Time.unscaledTime;
  319. Vector2 rawMoveVector = this.GetRawMoveVector();
  320. if (Mathf.Approximately(rawMoveVector.x, 0f) && Mathf.Approximately(rawMoveVector.y, 0f))
  321. {
  322. this.m_ConsecutiveMoveCount = 0;
  323. return false;
  324. }
  325. bool flag = base.input.GetButtonDown(this.m_HorizontalAxis) || base.input.GetButtonDown(this.m_VerticalAxis);
  326. bool flag2 = Vector2.Dot(rawMoveVector, this.m_LastMoveVector) > 0f;
  327. if (!flag)
  328. {
  329. if (flag2 && this.m_ConsecutiveMoveCount == 1)
  330. {
  331. flag = (unscaledTime > this.m_PrevActionTime + this.m_RepeatDelay);
  332. }
  333. else
  334. {
  335. flag = (unscaledTime > this.m_PrevActionTime + 1f / this.m_InputActionsPerSecond);
  336. }
  337. }
  338. if (!flag)
  339. {
  340. return false;
  341. }
  342. AxisEventData axisEventData = this.GetAxisEventData(rawMoveVector.x, rawMoveVector.y, 0.6f);
  343. if (axisEventData.moveDir != MoveDirection.None)
  344. {
  345. ExecuteEvents.Execute<IMoveHandler>(base.eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler);
  346. if (!flag2)
  347. {
  348. this.m_ConsecutiveMoveCount = 0;
  349. }
  350. this.m_ConsecutiveMoveCount++;
  351. this.m_PrevActionTime = unscaledTime;
  352. this.m_LastMoveVector = rawMoveVector;
  353. }
  354. else
  355. {
  356. this.m_ConsecutiveMoveCount = 0;
  357. }
  358. return axisEventData.used;
  359. }
  360. protected void ProcessMouseEvent()
  361. {
  362. this.ProcessMouseEvent(0);
  363. }
  364. [Obsolete("This method is no longer checked, overriding it with return true does nothing!")]
  365. protected virtual bool ForceAutoSelect()
  366. {
  367. return false;
  368. }
  369. protected override PointerInputModule.MouseState GetMousePointerEventData(int id)
  370. {
  371. PointerEventData pointerEventData;
  372. bool pointerData = base.GetPointerData(-1, out pointerEventData, true);
  373. pointerEventData.Reset();
  374. if (pointerData)
  375. {
  376. pointerEventData.position = this.m_MousePosition;
  377. }
  378. Vector2 mousePosition = this.m_MousePosition;
  379. pointerEventData.delta = mousePosition - pointerEventData.position;
  380. pointerEventData.position = mousePosition;
  381. pointerEventData.scrollDelta = base.input.mouseScrollDelta;
  382. pointerEventData.button = PointerEventData.InputButton.Left;
  383. base.eventSystem.RaycastAll(pointerEventData, this.m_RaycastResultCache);
  384. RaycastResult pointerCurrentRaycast = BaseInputModule.FindFirstRaycast(this.m_RaycastResultCache);
  385. pointerEventData.pointerCurrentRaycast = pointerCurrentRaycast;
  386. this.m_RaycastResultCache.Clear();
  387. PointerEventData pointerEventData2;
  388. base.GetPointerData(-2, out pointerEventData2, true);
  389. base.CopyFromTo(pointerEventData, pointerEventData2);
  390. pointerEventData2.button = PointerEventData.InputButton.Right;
  391. PointerEventData pointerEventData3;
  392. base.GetPointerData(-3, out pointerEventData3, true);
  393. base.CopyFromTo(pointerEventData, pointerEventData3);
  394. pointerEventData3.button = PointerEventData.InputButton.Middle;
  395. this.m_MouseState.SetButtonState(PointerEventData.InputButton.Left, base.StateForMouseButton(0), pointerEventData);
  396. this.m_MouseState.SetButtonState(PointerEventData.InputButton.Right, base.StateForMouseButton(1), pointerEventData2);
  397. this.m_MouseState.SetButtonState(PointerEventData.InputButton.Middle, base.StateForMouseButton(2), pointerEventData3);
  398. return this.m_MouseState;
  399. }
  400. private static bool ShouldStartDrag(Vector2 pressPos, Vector2 currentPos, float threshold, bool useDragThreshold)
  401. {
  402. return !useDragThreshold || (pressPos - currentPos).sqrMagnitude >= threshold * threshold;
  403. }
  404. protected override void ProcessMove(PointerEventData pointerEvent)
  405. {
  406. GameObject gameObject = pointerEvent.pointerCurrentRaycast.gameObject;
  407. base.HandlePointerExitAndEnter(pointerEvent, gameObject);
  408. }
  409. protected override void ProcessDrag(PointerEventData pointerEvent)
  410. {
  411. if (!pointerEvent.IsPointerMoving() || pointerEvent.pointerDrag == null)
  412. {
  413. return;
  414. }
  415. if (!pointerEvent.dragging && StandaloneInputModule2.ShouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, (float)base.eventSystem.pixelDragThreshold, pointerEvent.useDragThreshold))
  416. {
  417. ExecuteEvents.Execute<IBeginDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler);
  418. pointerEvent.dragging = true;
  419. }
  420. if (pointerEvent.dragging)
  421. {
  422. if (pointerEvent.pointerPress != pointerEvent.pointerDrag)
  423. {
  424. ExecuteEvents.Execute<IPointerUpHandler>(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
  425. pointerEvent.eligibleForClick = false;
  426. pointerEvent.pointerPress = null;
  427. pointerEvent.rawPointerPress = null;
  428. }
  429. ExecuteEvents.Execute<IDragHandler>(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler);
  430. }
  431. }
  432. protected void ProcessMouseEvent(int id)
  433. {
  434. PointerInputModule.MouseState mousePointerEventData = this.GetMousePointerEventData(id);
  435. PointerInputModule.MouseButtonEventData eventData = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
  436. this.m_CurrentFocusedGameObject = eventData.buttonData.pointerCurrentRaycast.gameObject;
  437. this.ProcessMousePress(eventData);
  438. this.ProcessMove(eventData.buttonData);
  439. this.ProcessDrag(eventData.buttonData);
  440. this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData);
  441. this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData);
  442. this.ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData);
  443. this.ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData);
  444. if (!Mathf.Approximately(eventData.buttonData.scrollDelta.sqrMagnitude, 0f))
  445. {
  446. GameObject eventHandler = ExecuteEvents.GetEventHandler<IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject);
  447. ExecuteEvents.ExecuteHierarchy<IScrollHandler>(eventHandler, eventData.buttonData, ExecuteEvents.scrollHandler);
  448. }
  449. }
  450. protected bool SendUpdateEventToSelectedObject()
  451. {
  452. if (base.eventSystem.currentSelectedGameObject == null)
  453. {
  454. return false;
  455. }
  456. BaseEventData baseEventData = this.GetBaseEventData();
  457. ExecuteEvents.Execute<IUpdateSelectedHandler>(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.updateSelectedHandler);
  458. return baseEventData.used;
  459. }
  460. protected void ProcessMousePress(PointerInputModule.MouseButtonEventData data)
  461. {
  462. PointerEventData buttonData = data.buttonData;
  463. GameObject gameObject = buttonData.pointerCurrentRaycast.gameObject;
  464. if (data.PressedThisFrame())
  465. {
  466. buttonData.eligibleForClick = true;
  467. buttonData.delta = Vector2.zero;
  468. buttonData.dragging = false;
  469. buttonData.useDragThreshold = true;
  470. buttonData.pressPosition = buttonData.position;
  471. buttonData.pointerPressRaycast = buttonData.pointerCurrentRaycast;
  472. base.DeselectIfSelectionChanged(gameObject, buttonData);
  473. GameObject gameObject2 = ExecuteEvents.ExecuteHierarchy<IPointerDownHandler>(gameObject, buttonData, ExecuteEvents.pointerDownHandler);
  474. if (gameObject2 == null)
  475. {
  476. gameObject2 = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  477. }
  478. float unscaledTime = Time.unscaledTime;
  479. if (gameObject2 == buttonData.lastPress)
  480. {
  481. float num = unscaledTime - buttonData.clickTime;
  482. if (num < 0.3f)
  483. {
  484. buttonData.clickCount++;
  485. }
  486. else
  487. {
  488. buttonData.clickCount = 1;
  489. }
  490. buttonData.clickTime = unscaledTime;
  491. }
  492. else
  493. {
  494. buttonData.clickCount = 1;
  495. }
  496. buttonData.pointerPress = gameObject2;
  497. buttonData.rawPointerPress = gameObject;
  498. buttonData.clickTime = unscaledTime;
  499. buttonData.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
  500. if (buttonData.pointerDrag != null)
  501. {
  502. ExecuteEvents.Execute<IInitializePotentialDragHandler>(buttonData.pointerDrag, buttonData, ExecuteEvents.initializePotentialDrag);
  503. }
  504. }
  505. if (data.ReleasedThisFrame())
  506. {
  507. ExecuteEvents.Execute<IPointerUpHandler>(buttonData.pointerPress, buttonData, ExecuteEvents.pointerUpHandler);
  508. GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
  509. if (buttonData.pointerPress == eventHandler && buttonData.eligibleForClick)
  510. {
  511. ExecuteEvents.Execute<IPointerClickHandler>(buttonData.pointerPress, buttonData, ExecuteEvents.pointerClickHandler);
  512. }
  513. else if (buttonData.pointerDrag != null && buttonData.dragging)
  514. {
  515. ExecuteEvents.ExecuteHierarchy<IDropHandler>(gameObject, buttonData, ExecuteEvents.dropHandler);
  516. }
  517. buttonData.eligibleForClick = false;
  518. buttonData.pointerPress = null;
  519. buttonData.rawPointerPress = null;
  520. if (buttonData.pointerDrag != null && buttonData.dragging)
  521. {
  522. ExecuteEvents.Execute<IEndDragHandler>(buttonData.pointerDrag, buttonData, ExecuteEvents.endDragHandler);
  523. }
  524. buttonData.dragging = false;
  525. buttonData.pointerDrag = null;
  526. if (gameObject != buttonData.pointerEnter)
  527. {
  528. base.HandlePointerExitAndEnter(buttonData, null);
  529. base.HandlePointerExitAndEnter(buttonData, gameObject);
  530. }
  531. }
  532. }
  533. protected GameObject GetCurrentFocusedGameObject()
  534. {
  535. return this.m_CurrentFocusedGameObject;
  536. }
  537. private float m_PrevActionTime;
  538. private Vector2 m_LastMoveVector;
  539. private int m_ConsecutiveMoveCount;
  540. private Vector2 m_LastMousePosition;
  541. private Vector2 m_MousePosition;
  542. private GameObject m_CurrentFocusedGameObject;
  543. [SerializeField]
  544. private string m_HorizontalAxis = "Horizontal";
  545. [SerializeField]
  546. private string m_VerticalAxis = "Vertical";
  547. [SerializeField]
  548. private string m_SubmitButton = "Submit";
  549. [SerializeField]
  550. private string m_CancelButton = "Cancel";
  551. [SerializeField]
  552. private float m_InputActionsPerSecond = 10f;
  553. [SerializeField]
  554. private float m_RepeatDelay = 0.5f;
  555. [SerializeField]
  556. [FormerlySerializedAs("m_AllowActivationOnMobileDevice")]
  557. private bool m_ForceModuleActive;
  558. private readonly PointerInputModule.MouseState m_MouseState = new PointerInputModule.MouseState();
  559. [Obsolete("Mode is no longer needed on input module as it handles both mouse and keyboard simultaneously.", false)]
  560. public enum InputMode
  561. {
  562. Mouse,
  563. Buttons
  564. }
  565. }
  566. }