コード例 #1
0
    void OnGUI()
    {
        GUI.skin = guiskin;
        //title bar
        GUI.Box(new Rect(0, 0, Screen.width, 36), "Lesson36", "Titlebar");

        //menu box
        GUI.Box(new Rect(0, Screen.height - 72, Screen.width, Screen.height), "", "Menubar");
        GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height));
        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Shot", "Shot"))
        {
            if (cameraView.isPlaying())
            {
                cameraView.Pause();
            }
            else
            {
                cameraView.Play();
            }
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Rotete", "Rotate"))
        {
            rotY += 90.0f;
            Vector3 rot = new Vector3(0, rotY, 0);
            transform.parent.Rotate(rot);
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Brightness", "Brightness"))
        {
            mainLight.enabled = !mainLight.enabled;
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("About", "About"))
        {
            visibleWindow = true;
        }

        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.EndArea();

        if (visibleWindow)
        {
            windowRect = GUI.Window(0, windowRect, DoMyWindow, "About");
        }
    }