Seven is the number.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
785 B

4 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. #if UNITY_EDITOR
  4. using UnityEditor;
  5. #endif
  6. public class PlanetRotate : MonoBehaviour
  7. {
  8. public static float GlobalSpeedup = 1.0f;
  9. public Vector3 InitialOrientation = Vector3.zero;
  10. public Vector3 RotationOrientation = Vector3.zero;
  11. private Vector3 CurrentOrientation = Vector3.zero;
  12. // Use this for initialization
  13. void Start()
  14. {
  15. #if UNITY_EDITOR
  16. EditorUtility.SetSelectedWireframeHidden(GetComponent<Renderer>(), true);
  17. #endif
  18. }
  19. // Update is called once per frame
  20. void Update()
  21. {
  22. CurrentOrientation += RotationOrientation * Time.deltaTime * GlobalSpeedup;
  23. transform.localRotation = Quaternion.Euler(InitialOrientation) * Quaternion.Euler(CurrentOrientation);
  24. }
  25. }