📜  将对象设置为随机颜色统一 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:49.135000             🧑  作者: Mango

代码示例1
[RequireComponent(typeof(Renderer))]
public class colorTint : MonoBehaviour
{
    public List TintColors;
    // Start is called before the first frame update
    void Start()
    {

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

            GetComponent().material.color = c;
    }