游戏 tabpanel

游戏 tabpanel
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 = 0;
        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 (10, 10, barResource.Length * 100, 30), select, barResource);

        if (oldSelect != select) {
            selectToggle0=false;
            selectToggle1=false;
        }

        switch (select) {
                
        case 0:
            selectToggle0=GUI.Toggle(new Rect(10,50,150,30),selectToggle0,"第一工具栏选项---1");
            selectToggle1=GUI.Toggle(new Rect(10,80,150,30),selectToggle1,"第一工具栏选项---2");
            break;
        case 1:
            selectToggle0=GUI.Toggle(new Rect(10,50,150,30),selectToggle0,"第二工具栏选项---1");
            selectToggle1=GUI.Toggle(new Rect(10,80,150,30),selectToggle1,"第二工具栏选项---2");
            break;
        case 2:
            selectToggle0=GUI.Toggle(new Rect(10,50,150,30),selectToggle0,"第三工具栏选项---1");
            selectToggle1=GUI.Toggle(new Rect(10,80,150,30),selectToggle1,"第三工具栏选项---2");
            break;
        case 3:
            selectToggle0=GUI.Toggle(new Rect(10,50,150,30),selectToggle0,"第四工具栏选项---1");
            selectToggle1=GUI.Toggle(new Rect(10,80,150,30),selectToggle1,"第四工具栏选项---2");
            break;
        }
    }
}
游戏 tabpanel

游戏 tabpanel

上一篇:坑爹JDK8,可怜的XP


下一篇:【wikioi】1296 营业额统计