f102759d-fcb3-4103-82e5-9a955401466a 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { _decorator, Component, Node, animation } from "cc";
  2. const { ccclass, property } = _decorator;
  3. @ccclass("<%UnderscoreCaseClassName%>")
  4. export class <%UnderscoreCaseClassName%> extends animation.StateMachineComponent {
  5. /**
  6. * Called right after a motion state is entered.
  7. * @param controller The animation controller it within.
  8. * @param motionStateStatus The status of the motion.
  9. */
  10. public onMotionStateEnter (controller: animation.AnimationController, motionStateStatus: Readonly<animation.MotionStateStatus>): void {
  11. // Can be overrode
  12. }
  13. /**
  14. * Called when a motion state is about to exit.
  15. * @param controller The animation controller it within.
  16. * @param motionStateStatus The status of the motion.
  17. */
  18. public onMotionStateExit (controller: animation.AnimationController, motionStateStatus: Readonly<animation.MotionStateStatus>): void {
  19. // Can be overrode
  20. }
  21. /**
  22. * Called when a motion state updated except for the first and last frame.
  23. * @param controller The animation controller it within.
  24. * @param motionStateStatus The status of the motion.
  25. */
  26. public onMotionStateUpdate (controller: animation.AnimationController, motionStateStatus: Readonly<animation.MotionStateStatus>): void {
  27. // Can be overrode
  28. }
  29. /**
  30. * Called right after a state machine is entered.
  31. * @param controller The animation controller it within.
  32. */
  33. public onStateMachineEnter (controller: animation.AnimationController) {
  34. // Can be overrode
  35. }
  36. /**
  37. * Called right after a state machine is entered.
  38. * @param controller The animation controller it within.
  39. */
  40. public onStateMachineExit (controller: animation.AnimationController) {
  41. // Can be overrode
  42. }
  43. }