CFX_AutoRotate.cs 378 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using System.Collections;
  3. // Cartoon FX - (c) 2013, Jean Moreno
  4. // Indefinitely rotates an object at a constant speed
  5. public class CFX_AutoRotate : MonoBehaviour
  6. {
  7. // Rotation speed & axis
  8. public Vector3 rotation;
  9. // Rotation space
  10. public Space space = Space.Self;
  11. void Update()
  12. {
  13. this.transform.Rotate(rotation * Time.deltaTime, space);
  14. }
  15. }