FaustAction.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System;
  2. using System.Collections.Generic;
  3. public class FaustAction : EnemyBaseAction
  4. {
  5. static Dictionary<string, int> _003C_003Ef__switch_0024map3;
  6. protected override void Start()
  7. {
  8. this.stateMachine.AddStates(typeof(FaustAction.StateEnum));
  9. this.stateMachine.OnEnter += this.OnMyStateEnter;
  10. base.AnimChangeState(FaustAction.StateEnum.Appear, 1f);
  11. }
  12. protected override void Update()
  13. {
  14. base.FaceToPlayer();
  15. base.Update();
  16. }
  17. private void OnMyStateEnter(object sender, StateMachine.StateEventArgs args)
  18. {
  19. string state = args.state;
  20. if (state != null)
  21. {
  22. if (FaustAction._003C_003Ef__switch_0024map3 == null)
  23. {
  24. FaustAction._003C_003Ef__switch_0024map3 = new Dictionary<string, int>(7)
  25. {
  26. {
  27. "Appear",
  28. 0
  29. },
  30. {
  31. "CallToIdle",
  32. 0
  33. },
  34. {
  35. "IdleToCall",
  36. 0
  37. },
  38. {
  39. "DisAppear",
  40. 0
  41. },
  42. {
  43. "Die",
  44. 0
  45. },
  46. {
  47. "Idle",
  48. 1
  49. },
  50. {
  51. "Call",
  52. 1
  53. }
  54. };
  55. }
  56. int num;
  57. if (FaustAction._003C_003Ef__switch_0024map3.TryGetValue(state, out num))
  58. {
  59. if (num != 0)
  60. {
  61. if (num == 1)
  62. {
  63. this.spineAnim.Play(args.state, true, false, 1f);
  64. }
  65. }
  66. else
  67. {
  68. this.spineAnim.Play(args.state, false, true, 1f);
  69. }
  70. }
  71. }
  72. }
  73. public override void AnimMove()
  74. {
  75. }
  76. public override void AnimReady()
  77. {
  78. base.AnimChangeState(FaustAction.StateEnum.Idle, 1f);
  79. }
  80. public override bool IsInAttackState()
  81. {
  82. return false;
  83. }
  84. public override bool IsInDeadState(string state)
  85. {
  86. return state == "Die";
  87. }
  88. public override bool IsInWeakSta()
  89. {
  90. return false;
  91. }
  92. protected override bool EnterAtkSta(string lastState, string nextState)
  93. {
  94. return false;
  95. }
  96. protected override bool ExitAtkSta(string lastState, string nextState)
  97. {
  98. return false;
  99. }
  100. public override bool IsInNormalState()
  101. {
  102. return base.IsInNormalState() && this.stateMachine.currentState == "Idle";
  103. }
  104. public enum StateEnum
  105. {
  106. Idle,
  107. Null,
  108. Appear,
  109. DisAppear,
  110. IdleToCall,
  111. Call,
  112. CallToIdle,
  113. Die
  114. }
  115. }