using UnityEngine;
using System.Collections;
public class GUI_scr : MonoBehaviour {
public bool cb1, cb2, cb3, cb4, cb5, cb6, cb7, cb8, cb9, cb10;
public bool[] cbxArr;
public string player1, player2, player3, player4, player5, player6, player7, player8, player9, player10;
public string[] playersArr;
public string score1, score2, score3, score4, score5, score6, score7, score8, score9, score10;
public string[] scoreArr;
void Start()
{
cbxArr = new bool[]{cb1, cb2, cb3, cb4, cb5, cb6, cb7, cb8, cb9, cb10};
scoreArr = new string[]{score1, score2, score3, score4, score5, score6, score7, score8, score9, score10};
playersArr = new string[]{player1, player2, player3, player4, player5, player6, player7, player8, player9, player10};
SetInitialValues(); // this doesn't work for some reason,
// all the toggle GUI items look like they were set to false,
// even though the debug log shows the values to be set to true.
cb7 = true; // this works fine, the toggle is visibly set to true.
}
void SetInitialValues()
{
for(int i = 0; i<cbxArr.Length; i++)
{cbxArr *= true;}*
-
for(int i = 0; i<scoreArr.Length; i++)*
_ {scoreArr = “0”;}_
* }*
* void OnGUI () {*
* DrawGUI ();*
* }*
* public void DrawGUI()*
* {*
* GUI.BeginGroup (new Rect(0,0,100,768));*
_ /for(int i = 0; i<10; i++)_
_ {_
_ GUI.BeginGroup(new Rect(0,60i, 100,80));
GUI.Box (new Rect(0,0,100,25), playersArr*);
GUI.Box (new Rect(0,25,70,25), scoreArr.ToString ());_
cbxArr _= (GUI.Toggle (new Rect(80,30,300,30),cbxArr,“”));
GUI.EndGroup ();
}/_
* GUI.BeginGroup(new Rect(0,0, 100,80));*
* player1 = GUI.TextArea(new Rect(0,0,100,25), player1);*
* GUI.Box (new Rect(0,25,70,25), score1);*
* cb1 = (GUI.Toggle (new Rect(80,30,300,30),cb1,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,60, 100,80));*
* player2 = GUI.TextArea(new Rect(0,0,100,25), player2);*
* GUI.Box (new Rect(0,25,70,25), score2);*
* cb2 = (GUI.Toggle (new Rect(80,30,300,30),cb2,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,120, 100,80));*
* player3 = GUI.TextArea(new Rect(0,0,100,25), player3);*
* GUI.Box (new Rect(0,25,70,25), score3);*
* cb3 = (GUI.Toggle (new Rect(80,30,300,30),cb3,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,180, 100,80));*
* player4 = GUI.TextArea(new Rect(0,0,100,25), player4);*
* GUI.Box (new Rect(0,25,70,25), score4);*
* cb4 = (GUI.Toggle (new Rect(80,30,300,30),cb4,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,240, 100,80));*
* player5 = GUI.TextArea(new Rect(0,0,100,25), player5);*
* GUI.Box (new Rect(0,25,70,25), score5);*
* cb5 = (GUI.Toggle (new Rect(80,30,300,30),cb5,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,300, 100,80));*
* player6 = GUI.TextArea(new Rect(0,0,100,25), player6);*
* GUI.Box (new Rect(0,25,70,25), score6);*
* cb6 = (GUI.Toggle (new Rect(80,30,300,30),cb6,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,360, 100,80));*
* player7 = GUI.TextArea(new Rect(0,0,100,25), player7);*
* GUI.Box (new Rect(0,25,70,25), score7);*
* cb7 = (GUI.Toggle (new Rect(80,30,300,30),cb7,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,420, 100,80));*
* player8 = GUI.TextArea(new Rect(0,0,100,25), player8);*
* GUI.Box (new Rect(0,25,70,25), score8);*
* cb8 = (GUI.Toggle (new Rect(80,30,300,30),cb8,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,480, 100,80));*
* player9 = GUI.TextArea(new Rect(0,0,100,25), player9);*
* GUI.Box (new Rect(0,25,70,25), score9);*
* cb9 = (GUI.Toggle (new Rect(80,30,300,30),cb9,“”));*
* GUI.EndGroup ();*
* GUI.BeginGroup(new Rect(0,540, 100,80));*
* player10 = GUI.TextArea(new Rect(0,0,100,25), player10);*
* GUI.Box (new Rect(0,25,70,25), score10);*
* cb10 = (GUI.Toggle (new Rect(80,30,300,30),cb10,“”));*
* GUI.EndGroup ();*
* GUI.Button (new Rect(0,700,50,20), “selAll”);*
* GUI.Button (new Rect(50,700,50,20), “next”);*
* GUI.EndGroup();*
* GUI.BeginGroup (new Rect(Screen.width - 90,0,90,768));*
* if(GUI.Button (new Rect(0,0,30, 20), “II”))*
* {*
* PauseGame ();*
* }*
* if(GUI.Button (new Rect(30,0,30,20),“o”))*
* {*
* ResetGame ();*
* }*
* if(GUI.Button (new Rect(60,0,30,20),“x”))*
* {*
* QuitGame ();*
* }*
* GUI.EndGroup ();*
* }*
* void PauseGame()*
* {*
* float timeScale = (Time.timeScale != 0 ? Time.timeScale = 0 : Time.timeScale = 1);*
* }*
* void ResetGame()*
* {*
* Application.LoadLevel (0);*
* }*
* void QuitGame()*
* {*
* Application.Quit ();*
* }*
}