您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

41 行
1018B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace coa4u
  5. {
  6. /// <summary>
  7. /// Delays the action for the given amount of seconds.
  8. /// </summary>
  9. class ActionDelay : ActionInterval
  10. {
  11. protected float durationMin;
  12. protected float durationMax;
  13. public ActionDelay(float tgtDuration)
  14. : base(tgtDuration)
  15. {
  16. durationMin = tgtDuration;
  17. durationMax = tgtDuration;
  18. }
  19. public ActionDelay(float tgtDuration, float tgtDurationMax)
  20. : base(tgtDuration)
  21. {
  22. durationMin = tgtDuration;
  23. durationMax = tgtDurationMax;
  24. }
  25. /// <summary>
  26. /// This method is called at the action start.
  27. /// </summary>
  28. public override void start()
  29. {
  30. base.start();
  31. if (durationMax != null)
  32. {
  33. duration = UnityEngine.Random.Range(durationMin, durationMax);
  34. }
  35. }
  36. }
  37. }