Horje
unity how get random color to material Code Example
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;
    }
unity how get random color to material
//using Color32
Color32 randomColor = new Color32(
	 System.Convert.ToByte(Random.Range(0, 255)), //Red
	 System.Convert.ToByte(Random.Range(0, 255)), //Green
	 System.Convert.ToByte(Random.Range(0, 255)), //Blue
	 System.Convert.ToByte(255), //Alpha (transparency)
);




Csharp

Related
poems Code Example poems Code Example
unity 2d swap out background image Code Example unity 2d swap out background image Code Example
gridview edit update delete in asp.net textbox size Code Example gridview edit update delete in asp.net textbox size Code Example
xamarin c# switch on hotspot Programmatically Code Example xamarin c# switch on hotspot Programmatically Code Example
how to make a destroy reference in unity Code Example how to make a destroy reference in unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7