Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

set object to random color unity

[RequireComponent(typeof(Renderer))]
public class colorTint : MonoBehaviour
{
    public List<Color> TintColors;
    // Start is called before the first frame update
    void Start()
    {

            Color c = TintColors[Random.Range(0, TintColors.Count)];

            GetComponent<Renderer>().material.color = c;
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity hide in inspector 
Csharp :: key press up unity 
Csharp :: csharp check if env is development 
Csharp :: how to generate random numbers in c# 
Csharp :: unity cast float to int 
Csharp :: json get request c# 
Csharp :: transformar de string a int c# 
Csharp :: How to search for a string from readline in c# 
Csharp :: repeat 10 timesw c# 
Csharp :: lat long data type c# 
Csharp :: reverse for loop unity 
Csharp :: getname of month from date c# 
Csharp :: c# get class name by type 
Csharp :: unity custom update 
Csharp :: how to reference a child object unity 
Csharp :: is keyboard clicked in Unity 
Csharp :: c# compile into an exe 
Csharp :: c# how to get connection string from app config 
Csharp :: convert string to date in c# 
Csharp :: c# letters only 
Csharp :: how to deselect a button through code unity 
Csharp :: C# array index tostring 
Csharp :: csharp 
Csharp :: how unsort the data table options 
Csharp :: c# join string array 
Csharp :: c# indexof 
Csharp :: c# list remove item based on property duplicate 
Csharp :: add dependency injection .net core console app 
Csharp :: get client ip address c# 
Csharp :: OnMousedown unity ui 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =