You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

32 lines
572B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. class ActionSetRotation : Action
  5. {
  6. protected Vector3 value;
  7. public ActionSetRotation(Vector3 tgtValue)
  8. : base()
  9. {
  10. value = tgtValue;
  11. }
  12. public ActionSetRotation(float angle)
  13. : this(new Vector3(0, 0, angle))
  14. {
  15. is2d = true;
  16. }
  17. public override Action clone()
  18. {
  19. return new ActionSetRotation(value);
  20. }
  21. public override void start()
  22. {
  23. base.start();
  24. transform.rotation = Quaternion.Euler(value);
  25. }
  26. }