armaan8014

AC KB&C Input Method

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