Esempio n. 1
0
    void OnGUI()
    {
        if (!CardboardOnGUI.OKToDraw(this))
        {
            return;
        }
        if (isLooking && !gonnaShow)
        {
            GUI.Label(new Rect(Screen.width / 2 - SizeX / 2, Screen.height / 2 - SizeY / 2, SizeX, SizeY), circle_focus);

            GUI.DrawTexture(new Rect(0, 3 * Screen.height / 6, Screen.width, Screen.height / 6), blackTransparent);

            style.fontSize         = Screen.width / 50;
            style.font             = myFont;
            style.normal.textColor = Color.white;
            style.alignment        = TextAnchor.MiddleCenter;

            if (cameraPoint == "pic1")
            {
                mytext = answers[curPanorama, 0];
            }
            else if (cameraPoint == "pic2")
            {
                mytext = answers[curPanorama, 1];
            }
            else if (cameraPoint == "pic3")
            {
                mytext = answers[curPanorama, 2];
            }
            else if (cameraPoint == "pic4")
            {
                mytext = answers[curPanorama, 3];
            }
            else if (cameraPoint == "pic5")
            {
                mytext = answers[curPanorama, 4];
            }


            GUI.Label(new Rect(Screen.width / 4, 3 * Screen.height / 6, Screen.width / 2, Screen.height / 6), mytext, style);
        }
        else
        {
            GUI.Label(new Rect(Screen.width / 2 - Screen.width / 100, Screen.height / 2 - Screen.width / 100, Screen.width / 50, Screen.width / 50), circle_idle);

            if (gonnaShow)
            {
                if (iscorrect)
                {
                    GUI.DrawTexture(new Rect(0, 3 * Screen.height / 6, Screen.width, Screen.height / 6), greenTransparent);
                    GUI.Label(new Rect(Screen.width / 4, 3 * Screen.height / 6, Screen.width / 2, Screen.height / 6), "CORRECT!", style);
                }
                else
                {
                    GUI.DrawTexture(new Rect(0, 3 * Screen.height / 6, Screen.width, Screen.height / 6), redTransparent);
                    GUI.Label(new Rect(Screen.width / 4, 3 * Screen.height / 6, Screen.width / 2, Screen.height / 6), "WRONG", style);
                }
            }
        }
    }
Esempio n. 2
0
 void OnGUI()
 {
     if (!CardboardOnGUI.OKToDraw(this))
     {
         return;
     }
     if (GUI.Button(new Rect(50, 50, 200, 50), "Reset"))
     {
         Reset();
     }
     if (GUI.Button(new Rect(50, 110, 200, 50), "Recenter"))
     {
         Cardboard.SDK.Recenter();
     }
     if (GUI.Button(new Rect(50, 170, 200, 50), "VR Mode"))
     {
         ToggleVRMode();
     }
 }