ReleaseAreaClock.cs 670 B

1234567891011121314151617181920212223242526272829303132333435
  1. #if CHRONOS_PLAYMAKER
  2. using HutongGames.PlayMaker;
  3. namespace Chronos.PlayMaker
  4. {
  5. [ActionCategory("Chronos")]
  6. [Tooltip("Releases all timelines within an area clock.")]
  7. [HelpUrl("http://ludiq.io/chronos/documentation#AreaClock.ReleaseAll")]
  8. public class ReleaseAreaClock : ChronosComponentAction<Clock>
  9. {
  10. [RequiredField]
  11. [CheckForComponent(typeof(IAreaClock))]
  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. areaClock.ReleaseAll();
  25. }
  26. }
  27. }
  28. #endif