JackAimReal.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using UnityEngine;
  3. public class JackAimReal : BaseBehaviour
  4. {
  5. public Transform Jack
  6. {
  7. private get
  8. {
  9. return this._jack;
  10. }
  11. set
  12. {
  13. this._jack = value;
  14. this._jackAction = value.GetComponent<JackAction>();
  15. }
  16. }
  17. private void Awake()
  18. {
  19. this._skeletonAnimation = base.GetComponentInChildren<SkeletonAnimation>();
  20. this._animation = base.GetComponent<Animation>();
  21. }
  22. private void Update()
  23. {
  24. if (this.Jack == null)
  25. {
  26. return;
  27. }
  28. if (this._jackAction.IsInWeakSta())
  29. {
  30. this._animation.Play("ShowDisappear");
  31. }
  32. }
  33. private void PlaySpine(string name)
  34. {
  35. this._skeletonAnimation.skeleton.SetToSetupPose();
  36. this._skeletonAnimation.state.SetAnimation(0, name, false);
  37. this._skeletonAnimation.Update(0f);
  38. }
  39. public void PlayShoot()
  40. {
  41. this.PlaySpine("ShowShoot");
  42. this._animation.Play("ShowShoot");
  43. }
  44. public void PlayShootEnd()
  45. {
  46. this.PlaySpine("ShowShootEnd");
  47. this._animation.Play("ShowShootEnd");
  48. }
  49. public void PlayDisappear()
  50. {
  51. this.PlaySpine("ShowDisappear");
  52. this._animation.Play("ShowDisappear");
  53. }
  54. public void PlayDestroy()
  55. {
  56. UnityEngine.Object.Destroy(base.gameObject);
  57. }
  58. public void PlayShootEffect()
  59. {
  60. Transform transform = R.Effect.Generate(202, null, base.transform.position, default(Vector3), default(Vector3), true);
  61. R.Audio.PlayEffect(321, new Vector3?(transform.position));
  62. EnemyBullet component = transform.GetComponent<EnemyBullet>();
  63. component.SetAtkData(this.Jack.GetComponent<JackAnimEvent>().jsonData["Atk5Ready"]);
  64. component.origin = this.Jack.gameObject;
  65. }
  66. private Transform _jack;
  67. private SkeletonAnimation _skeletonAnimation;
  68. private Animation _animation;
  69. private JackAction _jackAction;
  70. }