ReleaseTimeline.cs 673 B

1234567891011121314151617181920212223242526272829303132333435
  1. #if CHRONOS_PLAYMAKER
  2. using HutongGames.PlayMaker;
  3. namespace Chronos.PlayMaker
  4. {
  5. [ActionCategory("Chronos")]
  6. [Tooltip("Releases a timeline from all area clocks.")]
  7. [HelpUrl("http://ludiq.io/chronos/documentation#Timeline.ReleaseFromAll")]
  8. public class ReleaseTimeline : ChronosComponentAction<Timeline>
  9. {
  10. [RequiredField]
  11. [CheckForComponent(typeof(Timeline))]
  12. public FsmOwnerDefault gameObject;
  13. public override void Reset()
  14. {
  15. gameObject = null;
  16. }
  17. public override void OnEnter()
  18. {
  19. DoAction();
  20. }
  21. private void DoAction()
  22. {
  23. if (!UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject))) return;
  24. timeline.ReleaseFromAll();
  25. }
  26. }
  27. }
  28. #endif