Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Color[] MatrixColor= new Color[500];
- public string[] MColor = new string[500];
- void OnGUI()
- {
- switch (state)
- {
- case 0:
- state = 1;
- DefaultArray();
- break;
- case 1:
- break;
- }
- GUI.skin.button = style;
- for (i = 0; i < 16; i++)
- {
- for (j = 0; j < 8; j++)
- {
- int x = j + i;
- Color MyColor;
- ColorUtility.TryParseHtmlString(MColor[x], out MyColor);
- GUI.backgroundColor = MyColor;
- // GUI.backgroundColor=MatrixColor[x];
- if (GUI.Button(new Rect(100+(j * 50),100+( i * 50), 50, 50), ""))
- Debug.Log("Geklickt:" + (j+i));
- }
- }
- }
- public void DefaultArray()
- {
- for(int z=0; z < 400 ; z++)
- {
- if ((z % 2) == 0)
- {
- MColor[z] = "white";
- //MatrixColor[z] = Color.white;
- }
- else
- {
- MColor[z] = "grey";
- // MatrixColor[z] = Color.grey;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment