2026-03-18 20:09:32 +03:00

24 lines
543 B
C#

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<MeshRenderer>().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);
}
}