Task.cs 313 B

123456789101112131415161718192021222324
  1. using System;
  2. namespace com.workman.cm3d2.task
  3. {
  4. public class Task
  5. {
  6. public void SetInterval(float interval)
  7. {
  8. this.interval = interval;
  9. }
  10. public virtual void Execute()
  11. {
  12. if (this.action != null)
  13. {
  14. this.action();
  15. }
  16. }
  17. public float interval = 1f;
  18. public Action action;
  19. }
  20. }