void OnGUI()
    {
        float buttonX     = 0;
        float buttonY     = 0;
        float buttonW     = 200;
        float spaceHeight = 30;

        GUILayout.BeginArea(new Rect(buttonX, buttonY, buttonW, Screen.height));
        GUILayout.BeginVertical();

        GUILayout.Space(spaceHeight);

        if (GUILayout.Button("Play Anim", GUILayout.Height(m_debugMenuButtonH)))
        {
            BMLData data = new BMLData();
            StartCoroutine(TestPlayAnimation("ChrBrad@Idle01_ChopBoth01", data));
        }

        if (GUILayout.Button("Play Anim w/Start", GUILayout.Height(m_debugMenuButtonH)))
        {
            BMLData data = new BMLData();
            data.hasStart = true;
            data.start    = 1;
            StartCoroutine(TestPlayAnimation("ChrBrad@Idle01_ChopBoth01", data));
        }

        if (GUILayout.Button("Play Anim w/Stroke", GUILayout.Height(m_debugMenuButtonH)))
        {
            BMLData data = new BMLData();
            data.hasStroke = true;
            data.stroke    = 3;
            StartCoroutine(TestPlayAnimation("ChrBrad@Idle01_ChopBoth01", data));
        }

        if (GUILayout.Button("Play Anim w/End", GUILayout.Height(m_debugMenuButtonH)))
        {
            BMLData data = new BMLData();
            data.hasEnd = true;
            data.end    = 5;
            StartCoroutine(TestPlayAnimation("ChrBrad@Idle01_ChopBoth01", data));
        }

        if (GUILayout.Button("Gaze Camera", GUILayout.Height(m_debugMenuButtonH)))
        {
            StartCoroutine(TestGazeCamera());
        }


        foreach (int i in faceUnits)
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label(string.Format(@"au_{0}:", i), GUILayout.Width(40));

            float newSlider = GUILayout.HorizontalSlider(m_faceSliders[i], 0, 1);
            if (newSlider != m_faceSliders[i])
            {
                m_faceSliders[i] = newSlider;

                string side;
                switch (m_faceBothLeftRight[i])
                {
                case 0: side = "both"; break;

                case 1: side = "left"; break;

                case 2: side = "right"; break;

                default: side = ""; break;
                }

                StartCoroutine(TestSetFaceAnimationImmediate(i, side, m_faceSliders[i]));
            }

            m_faceBothLeftRight[i] = GUILayout.SelectionGrid(m_faceBothLeftRight[i], m_faceBothLeftRightText, 3);

            GUILayout.EndHorizontal();
        }


        GUILayout.Space(spaceHeight);

        if (GUILayout.Button("Reset", GUILayout.Height(m_debugMenuButtonH)))
        {
            StartCoroutine(TestReset());
        }

        GUILayout.EndVertical();
        GUILayout.EndArea();

        string     testStatusLabel = m_testStatusLabel.Replace("@time", string.Format("{0:f2}", Time.time - m_testStatusStartTime));
        TextAnchor origAnchor      = GUI.skin.label.alignment;

        GUI.skin.label.alignment = TextAnchor.UpperCenter;
        Rect rectLabel = new Rect(0.0f, 0.1f, 1.0f, 1.0f);

        GUI.Label(VHGUI.ScaleToRes(ref rectLabel), testStatusLabel);
        GUI.skin.label.alignment = origAnchor;
    }
Esempio n. 2
0
    void OnGUI()
    {
        float buttonH;

        if (Application.platform == RuntimePlatform.IPhonePlayer ||
            Application.platform == RuntimePlatform.Android)
        {
            buttonH = 70;
        }
        else
        {
            buttonH = 20;
        }

        Rect r = new Rect(0.25f, 0.2f, 0.5f, 0.6f);

        GUILayout.BeginArea(VHGUI.ScaleToRes(ref r));
        GUILayout.BeginVertical();

        if (m_loadingLevelStatus != null)
        {
            GUI.enabled = false;
        }

        if (GUILayout.Button("Start Level", GUILayout.Height(buttonH)))
        {
            StartCoroutine(LoadLevel("vhAssetsTestScene"));
        }

        if (GUILayout.Button("Mecanim Test", GUILayout.Height(buttonH)))
        {
            StartCoroutine(LoadLevel("mecanim"));
        }

        if (GUILayout.Button("Mecanim Web Test", GUILayout.Height(buttonH)))
        {
            StartCoroutine(LoadLevel("mecanimWeb"));
        }

        GUILayout.Space(40);

        if (GUILayout.Button("Exit", GUILayout.Height(buttonH)))
        {
            VHUtils.ApplicationQuit();
        }

        if (m_loadingLevelStatus != null)
        {
            GUI.enabled = true;
        }


        if (m_loadingLevelStatus != null)
        {
            GUILayout.Space(40);

            GUILayout.Label("Loading Level");

            GUILayout.Box("", GUILayout.Height(buttonH), GUILayout.Width(m_loadingLevelStatus.progress * r.width));
        }


        GUILayout.EndVertical();
        GUILayout.EndArea();
    }