InitializeColor









How do I use Initialize Color
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: BlockScript.cs Copy
7  void Start ()
8     {
9         InitializeColor();
10     }
File name: BlockScript.cs Copy
12     public void InitializeColor()
13     {
14         GetComponent().material.color = new Color(Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f));
15     }
File name: GameManager.cs Copy
72     private void Restart()
73     {
74         foreach (var item in blocks)
75         {
76             item.SetActive(true);
77             item.GetComponent().InitializeColor();
78         }
79         Lives = 3;
80         Score = 0;
81     }

InitializeColor 122 lượt xem

Gõ tìm kiếm nhanh...