您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

45 行
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. }