Esempio n. 1
0
    void OnGUI()
    {
        //GUI.skin = guiSkin;

        if (GUI.Button(new Rect(Screen.width - GUIManager.OffsetX() - GUIManager.ButtonSize(), GUIManager.OffsetY(), GUIManager.ButtonSize(), GUIManager.ButtonSize()), GUIContent.none, GUIManager.Style.skip))
        {
            DialogueComplete();

            return;
        }

        if (ActiveInstance != null)
        {
            ActiveInstance.OnGUI(GUIManager.skin);
        }
        //if (currentDialogue >= 0)
        // {
        //     dialogues[currentDialogue].OnGUI(GUIManager.skin);
        // }
    }
Esempio n. 2
0
    void OnGUI()
    {
//        GUI.skin = GUIManager.GetSkin();

        if (GUI.Button(new Rect(GUIManager.OffsetX(), GUIManager.OffsetY(), GUIManager.ButtonSize(), GUIManager.ButtonSize()), "Pause", GUIManager.Style.pause))
        {
            AudioManager.PlaySFX("Level Swipe");

            GroupManager.main.activeGroup = GroupManager.main.group["Paused"];
        }

        if (ShowScoreHint && LevelManager.instance.settings.minScore > 0)
        {
            int scoreLeft = LevelManager.instance.settings.minScore - HandController.activeHand.score;
            if (scoreLeft <= 0)
            {
                GUIManager.Style.scoreHint.normal.textColor = Color.red;
            }
            else
            {
                GUIManager.Style.scoreHint.normal.textColor = Color.white;
            }
            GUI.Label(
                new Rect(Screen.width - GUIManager.OffsetX() - GUIManager.ButtonSize(),
                         Screen.height - GUIManager.OffsetY() - GUIManager.ButtonSize(),
                         GUIManager.ButtonSize(), GUIManager.ButtonSize()),
                scoreLeft.ToString(),
                GUIManager.Style.scoreHint);
        }

        if (Event.current.type.Equals(EventType.Repaint) && HandController.activeHand != null)
        {
            Material GUIpie  = GUIManager.GUIPie;
            Rect     drawPos = new Rect(GUIManager.OffsetX(), Screen.height - Screen.height * 0.1f - GUIManager.OffsetY() - Screen.height * 0.1f, Screen.height * 0.2f, Screen.height * 0.2f);
            GUIpie.SetFloat("Value", 1);
            GUIpie.color = new Color(1, 1, 1, 0.6f);
            //GUIpie.color = Color.white;
            Graphics.DrawTexture(drawPos, background, GUIpie);

            if (HandController.activeHand.Ratio > 0.001f)
            {
                GUIpie.SetFloat("Value", HandController.activeHand.Ratio);
                GUIpie.SetFloat("Clockwise", 0);
                GUIpie.color = new Color((1 - HandController.activeHand.Ratio) * 0.75f, 0.75f, 0, 0.5f);

                Graphics.DrawTexture(drawPos, circle, GUIpie);
            }
            int value = HandController.activeHand.value;

            //  GUIpie.SetFloat("Value", 1);
            //  GUIpie.color = Color.white;

            if (value <= HandController.MinValue)
            {
                if (value == HandController.MinValue)
                {
                    Graphics.DrawTexture(drawPos, handEmpty);
                }
                else if (value == -1)
                {
                    Graphics.DrawTexture(drawPos, warning1);
                }
                else if (value >= -2)
                {
                    Graphics.DrawTexture(drawPos, warning2);
                }
                if (HandController.activeHand.showingWarning)
                {
                    Graphics.DrawTexture(drawPos, warningSign);
                }
            }
            else
            {
                Graphics.DrawTexture(drawPos, hand);
            }
        }
    }
Esempio n. 3
0
    void OnGUI()
    {
        GUI.matrix = Matrix4x4.TRS(new Vector3(0.0f, currentScroll, 0.0f), Quaternion.identity, Vector3.one);

        //GUI.skin = GUIManager.GetSkin();

        //LOGO
        {
            GUI.DrawTexture(new Rect((Screen.width - Screen.height * logoSize * logoRatio) * 0.5f, Screen.height * 0.25f - Screen.height * logoSize * 0.5f, Screen.height * logoSize * logoRatio, Screen.height * logoSize), logoTexture);
        }
        //GUI.Label(new Rect(0, 0, Screen.width, Screen.height * 0.4f), "Handy MD", GUI.skin.GetStyle("title"));

        GUI.matrix = Matrix4x4.TRS(new Vector3(-currentScroll, 0.0f, 0.0f), Quaternion.identity, Vector3.one);

        // PLAY //
        {
            float size = Screen.height * 0.3f;
            if (GUI.Button(
                    new Rect((Screen.width - size) * 0.5f, (Screen.height - size) * 0.65f, size, size),
                    "", GUIManager.Style.play))
            {
                targetScroll = -ScreenScrollValue;
                AudioManager.PlaySFX("Menu Next");
            }
        }

        GUI.matrix = Matrix4x4.TRS(new Vector3(0.0f, -currentScroll, 0.0f), Quaternion.identity, Vector3.one);

        // LEFT CORNER //
        GUILayout.BeginArea(new Rect(GUIManager.OffsetX() * 2.0f, Screen.height - GUIManager.OffsetY() * 2.0f - GUIManager.ButtonSize(), 2.0f * GUIManager.ButtonSize(), GUIManager.ButtonSize()));

        GUILayout.BeginHorizontal();

        // Mute
        //TODO: Temporary hack, fix
        //string styleOfVolume = AudioListener.volume <= 0.001f ? "volume off" : "volume on";
        GUIStyle styleOfVolue = AudioListener.volume <= 0.001f ? GUIManager.Style.volumeOff: GUIManager.Style.volumeOn;

        if (GUILayout.Button("Mute", styleOfVolue, GUILayout.Width(GUIManager.ButtonSize()), GUILayout.Height(GUIManager.ButtonSize())))
        {
            AudioListener.volume = 1 - AudioListener.volume;
            PlayerPrefs.SetFloat("Audio Volume", AudioListener.volume);
        }

        // Credits
        if (GUILayout.Button("Credits", GUIManager.Style.credits, GUILayout.Width(GUIManager.ButtonSize()), GUILayout.Height(GUIManager.ButtonSize())))
        {
            AudioManager.PlaySFX("Level Swipe Reversed");
            GroupManager.main.activeGroup = GroupManager.main.group["Credits"];
        }

        GUILayout.EndHorizontal();

        GUILayout.EndArea();


        // RIGHT CORNER //
        GUILayout.BeginArea(new Rect(Screen.width - Screen.height / 10.0f - GUIManager.OffsetX() * 2.0f, Screen.height - Screen.height / 10.0f - GUIManager.OffsetY() * 2.0f, Screen.height / 10.0f, Screen.height / 10.0f));

        GUILayout.BeginHorizontal();

        // Url
        if (GUILayout.Button("i", GUIManager.Style.info, GUILayout.Width(Screen.height / 10.0f), GUILayout.Height(Screen.height / 10.0f)))
        {
            AudioManager.PlaySFX("Level Swipe Reversed");
            GroupManager.main.activeGroup = GroupManager.main.group["Donation"];
        }

        GUILayout.EndHorizontal();

        GUILayout.EndArea();
    }