armaan8014

AC KB&M Input method

May 12th, 2020
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. #if UNITY_EDITOR
  5. using UnityEditor;
  6. #endif
  7.  
  8. namespace AC
  9. {
  10.  
  11. [System.Serializable]
  12. public class ActionMouseInputMethod : Action
  13. {
  14.  
  15. // Declare variables here
  16.  
  17.  
  18. public ActionMouseInputMethod()
  19. {
  20. this.isDisplayed = true;
  21. category = ActionCategory.Custom;
  22. title = "KB&M Input Method";
  23. description = "Keyboard and Mouse input method";
  24. }
  25.  
  26.  
  27. override public float Run()
  28. {
  29. KickStarter.settingsManager.inputMethod = InputMethod.MouseAndKeyboard;
  30. KickStarter.settingsManager.hotspotDetection = HotspotDetection.MouseOver;
  31. KickStarter.settingsManager.hideLockedCursor = false;
  32. /*
  33. * The above settings depend on the requirements of your
  34. * project and can be customized according to your needs.
  35. */
  36.  
  37. if (!isRunning)
  38. {
  39. isRunning = true;
  40. return defaultPauseTime;
  41. }
  42. else
  43. {
  44. isRunning = false;
  45. return 0f;
  46. }
  47. }
  48.  
  49.  
  50. #if UNITY_EDITOR
  51.  
  52. override public void ShowGUI()
  53. {
  54. // Action-specific Inspector GUI code here
  55.  
  56. AfterRunningOption();
  57. }
  58.  
  59.  
  60. public override string SetLabel()
  61. {
  62. // Return a string used to describe the specific action's job.
  63.  
  64. string labelAdd = "";
  65. return labelAdd;
  66. }
  67.  
  68. #endif
  69.  
  70. }
  71.  
  72. }
Add Comment
Please, Sign In to add comment