You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

32 lines
702B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. class ActionDelay : ActionInterval
  5. {
  6. protected float durationMin;
  7. protected float durationMax;
  8. public ActionDelay(float tgtDuration)
  9. : base(tgtDuration)
  10. {
  11. durationMin = tgtDuration;
  12. durationMax = tgtDuration;
  13. }
  14. public ActionDelay(float tgtDuration, float tgtDurationMax)
  15. : base(tgtDuration)
  16. {
  17. durationMin = tgtDuration;
  18. durationMax = tgtDurationMax;
  19. }
  20. public override void start()
  21. {
  22. base.start();
  23. if (durationMax != null)
  24. {
  25. duration = UnityEngine.Random.Range(durationMin, durationMax);
  26. }
  27. }
  28. }