GetGlobalClock.cs 644 B

1234567891011121314151617181920212223242526272829303132
  1. #if CHRONOS_PLAYMAKER
  2. using HutongGames.PlayMaker;
  3. namespace Chronos.PlayMaker
  4. {
  5. [ActionCategory("Chronos")]
  6. [Tooltip("Stores a global clock on the timekeeper in a variable.")]
  7. [HelpUrl("http://ludiq.io/chronos/documentation#Timekeeper.Clock")]
  8. public class GetGlobalClock : FsmStateAction
  9. {
  10. [RequiredField]
  11. [UIHint(UIHint.Variable)]
  12. public FsmObject storeValue;
  13. [RequiredField]
  14. public FsmString globalClockKey;
  15. public override void Reset()
  16. {
  17. storeValue = null;
  18. globalClockKey = null;
  19. }
  20. public override void OnEnter()
  21. {
  22. storeValue.Value = Timekeeper.instance.Clock(globalClockKey.Value);
  23. }
  24. }
  25. }
  26. #endif