Rotating.cs 600 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using System.Collections;
  3. namespace ParticleFX01 {
  4. public class Rotating : MonoBehaviour {
  5. public Vector3 rotationSpeed=Vector3.zero;
  6. public Space relativeTo=Space.Self;
  7. // Update is called once per frame
  8. void Update () {
  9. transform.Rotate(rotationSpeed * Time.deltaTime, relativeTo);
  10. }
  11. public void ForcedRotation(float time)
  12. {
  13. transform.Rotate(rotationSpeed * time, relativeTo);
  14. }
  15. /*public void SetVerticalRotation(float rotation)
  16. {
  17. Vector3 _rot = transform.localEulerAngles;
  18. _rot.x = rotation;
  19. transform.localEulerAngles = _rot;
  20. }*/
  21. }
  22. }