No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
Este repositorio está archivado. Puede ver los archivos y clonarlo, pero no puede subir cambios o reportar incidencias ni pedir Pull Requests.

45 líneas
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. }