RotationTransform.cs 417 B

1234567891011121314151617181920212223
  1. // MIT License
  2. // https://gitlab.com/ilnprj
  3. // Copyright (c) 2020 ilnprj
  4. using UnityEngine;
  5. /// <summary>
  6. /// Example rotation
  7. /// </summary>
  8. public class RotationTransform : MonoBehaviour
  9. {
  10. [SerializeField]
  11. private Vector3 rotationVector = default;
  12. [SerializeField]
  13. private float speed = default;
  14. private void Update()
  15. {
  16. transform.Rotate(rotationVector * speed);
  17. }
  18. }