CharacterState.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public abstract class CharacterState
  5. {
  6. public void Init()
  7. {
  8. this.pab = R.Player.Abilities;
  9. this.pac = R.Player.Action;
  10. this.pAttr = R.Player.Attribute;
  11. this.stateMachine = R.Player.StateMachine;
  12. this.weapon = R.Player.GetComponent<Claymore>();
  13. this.msac = R.Player.GetComponent<MultiSpineAnimationController>();
  14. this.listener = R.Player.GetComponent<PlayerAnimEventListener>();
  15. }
  16. public virtual void Start()
  17. {
  18. }
  19. public virtual void OnEnable()
  20. {
  21. }
  22. public virtual void OnDisable()
  23. {
  24. }
  25. public virtual void OnDestroy()
  26. {
  27. }
  28. public virtual void Update()
  29. {
  30. }
  31. public virtual void FixedUpdate()
  32. {
  33. }
  34. public virtual void OnStateMachineStateTransfer(object sender, StateMachine.TransferEventArgs args)
  35. {
  36. }
  37. public virtual void OnStateMachineStateEnter(object sender, StateMachine.StateEventArgs args)
  38. {
  39. }
  40. public virtual void OnStateMachineStateExit(object sender, StateMachine.StateEventArgs args)
  41. {
  42. }
  43. public Coroutine StartCoroutine(IEnumerator routine)
  44. {
  45. return this.pab.StartCoroutine(routine);
  46. }
  47. public Coroutine StartCoroutine(string methodName)
  48. {
  49. return this.pab.StartCoroutine(methodName);
  50. }
  51. public Coroutine StartCoroutine(string methodName, object value)
  52. {
  53. return this.pab.StartCoroutine(methodName, value);
  54. }
  55. public Coroutine StartCoroutine_Auto(IEnumerator routine)
  56. {
  57. return this.pab.StartCoroutine(routine);
  58. }
  59. public void StopAllCoroutines()
  60. {
  61. this.pab.StopAllCoroutines();
  62. }
  63. public void StopCoroutine(Coroutine routine)
  64. {
  65. this.pab.StopCoroutine(routine);
  66. }
  67. public void StopCoroutine(IEnumerator routine)
  68. {
  69. this.pab.StopCoroutine(routine);
  70. }
  71. public void StopCoroutine(string methodName)
  72. {
  73. this.pab.StopCoroutine(methodName);
  74. }
  75. protected PlayerAction pac;
  76. protected PlayerAttribute pAttr;
  77. protected StateMachine stateMachine;
  78. protected Claymore weapon;
  79. protected MultiSpineAnimationController msac;
  80. protected PlayerAnimEventListener listener;
  81. protected PlayerAbilities pab;
  82. protected const int LEFT = -1;
  83. protected const int RIGHT = 1;
  84. protected const int UP = 2;
  85. protected const int DOWN = -2;
  86. protected const int RIGHT_DOWN = -4;
  87. protected const int LEFT_DOWN = -5;
  88. protected const int RIGHT_UP = 4;
  89. protected const int LEFT_UP = 5;
  90. protected const int STOP = 0;
  91. protected const int CURRENT = 3;
  92. }