Guest User

Untitled

a guest
Mar 24th, 2018
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. public Color[] MatrixColor= new Color[500];
  2. public string[] MColor = new string[500];
  3. void OnGUI()
  4. {
  5.  
  6.  
  7. switch (state)
  8. {
  9. case 0:
  10.  
  11. state = 1;
  12. DefaultArray();
  13. break;
  14.  
  15. case 1:
  16.  
  17.  
  18. break;
  19. }
  20.  
  21. GUI.skin.button = style;
  22.  
  23. for (i = 0; i < 16; i++)
  24. {
  25. for (j = 0; j < 8; j++)
  26. {
  27. int x = j + i;
  28. Color MyColor;
  29. ColorUtility.TryParseHtmlString(MColor[x], out MyColor);
  30. GUI.backgroundColor = MyColor;
  31.  
  32. // GUI.backgroundColor=MatrixColor[x];
  33.  
  34. if (GUI.Button(new Rect(100+(j * 50),100+( i * 50), 50, 50), ""))
  35. Debug.Log("Geklickt:" + (j+i));
  36. }
  37. }
  38.  
  39.  
  40. }
  41. public void DefaultArray()
  42. {
  43. for(int z=0; z < 400 ; z++)
  44. {
  45.  
  46.  
  47. if ((z % 2) == 0)
  48. {
  49. MColor[z] = "white";
  50. //MatrixColor[z] = Color.white;
  51. }
  52. else
  53. {
  54. MColor[z] = "grey";
  55. // MatrixColor[z] = Color.grey;
  56. }
  57. }
  58.  
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment