Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.

40 rindas
933B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace coa4u
  5. {
  6. class ActionMoveBy : ActionInterval
  7. {
  8. protected Vector3 delta;
  9. public ActionMoveBy(Vector3 tgtDelta, float tgtDuration)
  10. : base(tgtDuration)
  11. {
  12. delta = tgtDelta;
  13. }
  14. public ActionMoveBy(Vector2 tgtValue, float tgtDuration)
  15. : this((Vector3)tgtValue, tgtDuration)
  16. {
  17. is2d = true;
  18. }
  19. public override ActionInstant clone()
  20. {
  21. return new ActionMoveBy(delta, duration);
  22. }
  23. public override ActionInstant reverse()
  24. {
  25. return new ActionMoveBy(delta * -1F, duration);
  26. }
  27. public override void stepInterval(float dt)
  28. {
  29. float d = dt / duration;
  30. Vector3 tgt = delta * d;
  31. transform.Translate(tgt, Space.World);
  32. }
  33. }
  34. }