using UnityEngine;
using System.Collections; public class La : MonoBehaviour { private int select; private string[] barResource; private bool selectToggle0; private bool selectToggle1; // Use this for initialization
void Start () {
select = ;
barResource=new string[]{"第一工具栏","第二工具栏","第三工具栏","第四工具栏"};
selectToggle0=false;
selectToggle1=false;
} // Update is called once per frame
void Update () { } void OnGUI()
{
int oldSelect = select;
select = GUI.Toolbar (new Rect (, , barResource.Length * , ), select, barResource); if (oldSelect != select) {
selectToggle0=false;
selectToggle1=false;
} switch (select) { case :
selectToggle0=GUI.Toggle(new Rect(,,,),selectToggle0,"第一工具栏选项---1");
selectToggle1=GUI.Toggle(new Rect(,,,),selectToggle1,"第一工具栏选项---2");
break;
case :
selectToggle0=GUI.Toggle(new Rect(,,,),selectToggle0,"第二工具栏选项---1");
selectToggle1=GUI.Toggle(new Rect(,,,),selectToggle1,"第二工具栏选项---2");
break;
case :
selectToggle0=GUI.Toggle(new Rect(,,,),selectToggle0,"第三工具栏选项---1");
selectToggle1=GUI.Toggle(new Rect(,,,),selectToggle1,"第三工具栏选项---2");
break;
case :
selectToggle0=GUI.Toggle(new Rect(,,,),selectToggle0,"第四工具栏选项---1");
selectToggle1=GUI.Toggle(new Rect(,,,),selectToggle1,"第四工具栏选项---2");
break;
}
}
}