Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
To repozytorium jest zarchiwizowane. Możesz wyświetlać pliki i je sklonować, ale nie możesz do niego przepychać zmian lub otwierać zgłoszeń/Pull Requestów.

38 wiersze
738B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. class ActionScaleTo : ActionInterval
  5. {
  6. protected Vector3 value;
  7. protected Vector3 path;
  8. public ActionScaleTo(Vector3 tgtValue, float tgtDuration)
  9. : base(tgtDuration)
  10. {
  11. value = tgtValue;
  12. }
  13. public override Action clone()
  14. {
  15. return new ActionScaleTo(value, duration);
  16. }
  17. public override void start()
  18. {
  19. base.start();
  20. path = value - transform.localScale;
  21. }
  22. public override void stepInterval(float dt)
  23. {
  24. float d = dt / duration;
  25. Vector3 tgt = path * d;
  26. transform.localScale += tgt;
  27. }
  28. public override void stop()
  29. {
  30. base.stop();
  31. }
  32. }