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.

45 rindas
1014B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace coa4u
  5. {
  6. /// <summary>
  7. /// Instantly moves the target to the given point.
  8. /// </summary>
  9. class ActionSetPlace : ActionInstant
  10. {
  11. protected Vector3 value;
  12. public ActionSetPlace(Vector3 tgtPlace)
  13. : base()
  14. {
  15. value = tgtPlace;
  16. }
  17. public ActionSetPlace(Vector2 tgtPlace)
  18. : this((Vector3)tgtPlace)
  19. {
  20. is2d = true;
  21. }
  22. /// <summary>
  23. /// Returns a copy of the action.
  24. /// </summary>
  25. public override ActionInstant clone()
  26. {
  27. return new ActionSetPlace(value);
  28. }
  29. /// <summary>
  30. /// This method is called at the action start.
  31. /// </summary>
  32. public override void start()
  33. {
  34. base.start();
  35. if (is2d)
  36. value.z = transform.position.z;
  37. transform.position = value;
  38. }
  39. }
  40. }