using System.Collections; using System.Collections.Generic; using UnityEngine; public class Rotator : MonoBehaviour { [SerializeField] private float speed = 10.0f; private Material material; private void Start() { material = GetComponent().material; material.SetColor("_BaseColor", new Color(Random.value, Random.value, Random.value, 1)); } // Update is called once per frame void Update() { transform.Rotate(new Vector3(1, 0, 1) * speed * Time.deltaTime); } }