Test123/Assets/Scripts/SimpleBall.cs
Mohan pal singh ubhi e1a8060711
Some checks are pending
Code Documentation / code-docs (push) Waiting to run
Project Report / project-report (push) Waiting to run
Validate Code / validate (push) Waiting to run
Added Game Files
2026-06-15 21:01:44 +03:00

30 lines
684 B
C#

using UnityEngine;
namespace CrimsofallTechnologies.SimpleBall {
public class SimpleBall : MonoBehaviour
{
public MeshRenderer mRenderer;
public float rotationSpeed = 10f;
private void Start()
{
if(mRenderer != null)
{
mRenderer.material.color = Random.ColorHSV();
}
}
private void Update()
{
transform.Rotate(Vector3.up, rotationSpeed * Time.deltaTime);
}
private void OnMouseDown()
{
if(mRenderer != null)
{
mRenderer.material.color = Random.ColorHSV();
}
}
}
}