TrailRotation.cs 666 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using UnityEngine;
  3. public class TrailRotation : MonoBehaviour
  4. {
  5. private void Start()
  6. {
  7. this.rotationVector = new Vector3(this.rotationSpeedX, this.rotationSpeedY, this.rotationSpeedZ);
  8. }
  9. private void Update()
  10. {
  11. base.transform.Rotate(new Vector3(this.rotationSpeedX, this.rotationSpeedY, this.rotationSpeedZ) * Time.deltaTime);
  12. }
  13. private void OnDisable()
  14. {
  15. base.transform.localPosition = Vector3.zero;
  16. }
  17. [SerializeField]
  18. public float rotationSpeedX = 90f;
  19. [SerializeField]
  20. public float rotationSpeedY = 90f;
  21. [SerializeField]
  22. public float rotationSpeedZ = 90f;
  23. public Vector3 rotationVector;
  24. }