Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
To repozytorium jest zarchiwizowane. Możesz wyświetlać pliki i je sklonować, ale nie możesz do niego przepychać zmian lub otwierać zgłoszeń/Pull Requestów.

39 wiersze
862B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace coa4u
  5. {
  6. /// <summary>
  7. /// Instantly rotates the target.
  8. /// </summary>
  9. class ActionSetRotation : ActionInstant
  10. {
  11. protected Vector3 value;
  12. public ActionSetRotation(Vector3 targetValue)
  13. : base()
  14. {
  15. value = targetValue;
  16. }
  17. public ActionSetRotation(float angle)
  18. : this(new Vector3(0, 0, angle))
  19. {
  20. locks = Axises.rxy;
  21. }
  22. public override ActionInstant Clone()
  23. {
  24. return new ActionSetRotation(value);
  25. }
  26. public override void Start()
  27. {
  28. base.Start();
  29. if (locks != Axises.none)
  30. LockAxises(ref value);
  31. transform.rotation = Quaternion.Euler(value);
  32. }
  33. }
  34. }