ButtonHandler.cs 872 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using UnityEngine;
  3. namespace UnityStandardAssets.CrossPlatformInput
  4. {
  5. public class ButtonHandler : MonoBehaviour
  6. {
  7. public string Name;
  8. void OnEnable()
  9. {
  10. }
  11. public void SetDownState()
  12. {
  13. CrossPlatformInputManager.SetButtonDown(Name);
  14. }
  15. public void SetUpState()
  16. {
  17. CrossPlatformInputManager.SetButtonUp(Name);
  18. }
  19. public void SetAxisPositiveState()
  20. {
  21. CrossPlatformInputManager.SetAxisPositive(Name);
  22. }
  23. public void SetAxisNeutralState()
  24. {
  25. CrossPlatformInputManager.SetAxisZero(Name);
  26. }
  27. public void SetAxisNegativeState()
  28. {
  29. CrossPlatformInputManager.SetAxisNegative(Name);
  30. }
  31. public void Update()
  32. {
  33. }
  34. }
  35. }