using UnityEngine;

public sealed class RanromRotator : MonoBehaviour {

    [SerializeField]
    private Vector3 axe = Vector3.up;
    [SerializeField]
    private bool randomAxe = false;
    [SerializeField]
    private float minSpeed = 1f; // angles per second
    [SerializeField]
    private float maxSpeed = 1f; // angles per second

    private float speed = 1f; // angles per second

    private void Awake() {
        if (randomAxe)
            axe = Random.insideUnitSphere;
        axe.Normalize();
        speed = Random.Range(minSpeed, maxSpeed);
    }

    private void Update() {
        transform.Rotate(axe, speed * Time.deltaTime);
    }
}
