예제 #1
0
        private void OnGUI()
        {
            if (_showCounter <= 0)
            {
                return;
            }

            var textColor    = Color.white;
            var outlineColor = Color.black;

            if (_showCounter <= 1)
            {
                textColor.a    = _showCounter;
                outlineColor.a = _showCounter;
            }

            if (_textStyle == null)
            {
                _textStyle = new GUIStyle
                {
                    alignment = TextAnchor.UpperLeft,
                    fontSize  = 20
                };
            }

            const int xMargin     = 40;
            const int yMargin     = 20;
            var       displayRect = new Rect(xMargin, yMargin, Screen.width - xMargin * 2, Screen.height - yMargin);

            ShadowAndOutline.DrawOutline(displayRect, _shownLogText, _textStyle, outlineColor, textColor, 2);
        }
예제 #2
0
    void OnGUI()
    {
        // Title
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, titleFadeAlpha);

        Color inColor  = new Color(Color.black.r, Color.black.g, Color.black.b, titleFadeAlpha);
        Color outColor = new Color(Color.white.r, Color.white.g, Color.white.b, titleFadeAlpha);

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 50, (Screen.height / 2) - 50, 100, 100), "Memory Complete",
                                     dayStyle, outColor, inColor, 1);


        // Painting Progression
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, paintingsFadeAlpha);

        inColor  = new Color(Color.black.r, Color.black.g, Color.black.b, paintingsFadeAlpha);
        outColor = new Color(Color.white.r, Color.white.g, Color.white.b, paintingsFadeAlpha);

        string label1 = "Paintings: " + levelProgress.currentPaintings.ToString() + "/" + levelProgress.totalPaintings.ToString();

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 50, (Screen.height / 2) - 50, 100, 100),
                                     label1, dayStyle, outColor, inColor, 1);


        // Obstacle Progression
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, obstaclesFadeAlpha);

        inColor  = new Color(Color.black.r, Color.black.g, Color.black.b, obstaclesFadeAlpha);
        outColor = new Color(Color.white.r, Color.white.g, Color.white.b, obstaclesFadeAlpha);

        string label2 = "Conflicts: " + levelProgress.currentObstacles.ToString() + "/" + levelProgress.totalObstacles.ToString();

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 50, (Screen.height / 2) - 50, 100, 100),
                                     label2, dayStyle, outColor, inColor, 1);
    }
예제 #3
0
    void OnGUI()
    {
        //GUIStyle style = new GUIStyle ();
        //style.richText = true;
        float currentTime = Time.time;

        if (currentTime - startingTime <= duration)
        {
            show = true;
        }
        else if (show)
        {
            SoundManager.Instance.interruptSound("gibberish");
            if (onFinished != null)
            {
                onFinished();
            }
            show = false;
        }

        if (show)
        {
            ShadowAndOutline.DrawOutline(
                new Rect(left, top, right, bottom),
                dialogue,
                new GUIStyle(),
                Color.black,
                Color.white,
                3
                );

            isDialogueOn = true;
        }
    }
예제 #4
0
 void DrawTitle()
 {
     ShadowAndOutline.DrawOutline(new Rect(0, Screen.height * .25f, Screen.width, Screen.height * .5f), "Catapult!", titleStyle, Color.black, Color.white, 2f);
     if ((float.Parse(Time.time.ToString("0.0"))) % 3 < 2.5f)
     {
         ShadowAndOutline.DrawOutline(new Rect(0, Screen.height * .75f, Screen.width, Screen.height * .25f), "Click anywhere to play", instructionStyle, Color.black, Color.white, 2f);
     }
 }
예제 #5
0
    void OnGUI()
    {
        Color inColor = Color.black;

        inColor.a = titleAlpha;

        Color outColor = Color.white;

        outColor.a = titleAlpha;

        // Game title
        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 50, 0, 100, 100), "The Museum", titleStyle, outColor, inColor, 1);

        // Creator title
        //ShadowAndOutline.DrawOutline(new Rect((Screen.width/2) - 50, 0, 100, 100), "A game by Sunil Rao", creatorStyle, outColor, inColor, 1);

        inColor.a  = instructionAlpha;
        outColor.a = instructionAlpha;

        // Instructions
        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2), (Screen.height / 2), 100, 100), "Press the following keys to begin:", instructionStyle, outColor, inColor, 1);

        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, instructionKeyAlpha);

        //*************
        //  KEY LABELS
        //*************
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, wAlpha);
        // W Key
        GUI.DrawTexture(new Rect(400, (Screen.height - 200), 50, 50), keyTexture);
        GUI.Label(new Rect(400, (Screen.height - 200 + 5), 50, 50), "W", keyStyle);

        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, sAlpha);
        // S Key
        GUI.DrawTexture(new Rect(400, (Screen.height - 200) + 60, 50, 50), keyTexture);
        GUI.Label(new Rect(400, (Screen.height - 200 + 5) + 60, 50, 50), "S", keyStyle);

        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, aAlpha);
        // A Key
        GUI.DrawTexture(new Rect(400 - 60, (Screen.height - 200) + 60, 50, 50), keyTexture);
        GUI.Label(new Rect(400 - 60, (Screen.height - 200 + 5) + 60, 50, 50), "A", keyStyle);

        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, dAlpha);
        // D Key
        GUI.DrawTexture(new Rect(400 + 60, (Screen.height - 200) + 60, 50, 50), keyTexture);
        GUI.Label(new Rect(400 + 60, (Screen.height - 200 + 5) + 60, 50, 50), "D", keyStyle);

        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, lcAlpha);
        // Left Click Mouse
        GUI.DrawTexture(new Rect(Screen.width - 400, (Screen.height - 250), 100, 200), mouseTexture);
        GUI.Label(new Rect(Screen.width - 425, (Screen.height - 250), 100, 200), "L", keyStyle);

        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, rcAlpha);
        // Right Click Mouse
        GUI.DrawTexture(new Rect(Screen.width - 200, (Screen.height - 250), 100, 200), mouseTexture);
        GUI.Label(new Rect(Screen.width - 185, (Screen.height - 250), 100, 200), "R", keyStyle);
    }
예제 #6
0
    void OnGUI()
    {
        Color outColor = Color.white;
        Color inColor  = dialogueColor;

        outColor.a = dialogueAlpha;
        inColor.a  = dialogueAlpha;

        ShadowAndOutline.DrawOutline(new Rect(0, Screen.height - 70, Screen.width - 16, 50), "Sample dialogue", dialogueStyle, outColor, inColor, dialogueSize);
    }
예제 #7
0
    void DrawTime()
    {
        System.TimeSpan t = System.TimeSpan.FromSeconds(MainGameCode.gameTime);

        string timerFormatted = "Time: " + string.Format("{0:D2}m:{1:D2}s", t.Minutes, t.Seconds);

        Rect timerPosition = new Rect(Screen.width * .8f, 10, 1000, 1000);

        ShadowAndOutline.DrawOutline(timerPosition, timerFormatted, timerStyle, Color.black, Color.white, 2);
    }
예제 #8
0
    void OnGUI()
    {
        GUI.depth = 0;
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, fadeAlpha2);

        Color inColor  = new Color(Color.black.r, Color.black.g, Color.black.b, fadeAlpha2);
        Color outColor = new Color(Color.white.r, Color.white.g, Color.white.b, fadeAlpha2);

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 50, (Screen.height / 2) - 50, 100, 100), dayString,
                                     dayStyle, outColor, inColor, 1);
    }
예제 #9
0
    void AimInstructions()
    {
        string aimInstructionString = "";

        aimInstructionString += "ballista fires flat shots at low angles, ";
        aimInstructionString += "catapult fires spinning shots at high angles,\n";
        aimInstructionString += "trebuchet first high power spinning shots at a fixed angle\n and starts in an elevated position\n";
        aimInstructionString += "arrow keys to turn puck and tilt view, esc to cancel\nhold space to power up, release to fire";
        Rect instructionPosition = new Rect(0, Screen.height * .75f, Screen.width, Screen.height * .10f);

        ShadowAndOutline.DrawOutline(instructionPosition, aimInstructionString, instructionStyle, Color.black, Color.white, 2f);
    }
예제 #10
0
    void OnGUI()
    {
        Color inColor  = new Color(Color.black.r, Color.black.g, Color.black.b, promptAlpha);
        Color outColor = new Color(Color.white.r, Color.white.g, Color.white.b, promptAlpha);

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2), (Screen.height / 2), 500, 100), promptText,
                                     promptStyle, outColor, inColor, 1);


        //string zenText = currentZen + "/" + maxZen;
        //ShadowAndOutline.DrawOutline(new Rect((Screen.width/2), (Screen.height/10), 500, 100), zenText, zenStyle, outColor, inColor, 1);
    }
예제 #11
0
    void OnGUI()
    {
        // Sit Prompt
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, promptAlpha);
        Color inColor  = new Color(Color.black.r, Color.black.g, Color.black.b, promptAlpha);
        Color outColor = new Color(Color.white.r, Color.white.g, Color.white.b, promptAlpha);

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 250, (Screen.height / 2) - 50, 500, 100), promptText,
                                     promptStyle, outColor, inColor, 1);

        //GUI.Label(new Rect((Screen.width/2) - 250, (Screen.height/2) - 50, 500, 100), promptText, promptStyle);
    }
예제 #12
0
 public static void Draw(float maxQueries = Mathf.Infinity)
 {
     Rect r = me.m_consolePosition.GetPosition(me.width, me.height);
     if (chatEnabled)
     {
         GUILayout.BeginArea(new Rect(r.xMin, r.yMin, r.xMax + 5, r.yMax));
         GUILayout.Box("", GUILayout.Width(r.width + 5), GUILayout.Height(r.height));
         GUILayout.EndArea();
     }
     GUILayout.BeginArea(new Rect(r.xMin + (chatEnabled ? 5 : 0), r.yMin + (chatEnabled ? 5 : 0), r.width, r.height - 10));
     if (chatEnabled)
     {
         GUILayout.BeginVertical();
         consolePos = GUILayout.BeginScrollView(chatEnabled ? consolePos : Vector2.zero, false, chatEnabled, GUILayout.Width(r.width - 5), GUILayout.Height(r.height - 35));
     }
     else
         GUILayout.BeginArea(new Rect(0, -(_long < me.height ? 0 : _long - me.height), r.width, _long));
     if (log != null && log.Count > 0)
         for (int i = 0; i < log.Count; ++i)
         {
             FMessage fm = log[i];
             string m = fm.message;
             float h = _text.CalcHeight(new GUIContent(m), me.width - (chatEnabled ? 30 : 0));
             //GUILayout.Label(GetRandomness(fm), GUILayout.Width(me.width - (chatEnabled ? 30 : 0)), GUILayout.Height(h + _error));
             //I have to put an option to disable this option...
             //I have to fix the shadow
             ShadowAndOutline.DrawLayoutShadow(new GUIContent(GetRandomness(fm)), _text, Color.black, Color.black, Vector2.down + Vector2.left, GUILayout.Width(me.width - (chatEnabled ? 30 : 0)), GUILayout.Height(h + _error));
             //Searching for untracked styles here...
             //I have to fix for example this kind of strings "aaa&nxdxd&0xd" that is bugged
             DrawUnderline(GUILayoutUtility.GetLastRect(), fm);
             if (i >= maxQueries)
                 break;
         }
     if (chatEnabled)
     {
         GUILayout.EndScrollView();
         GUILayout.FlexibleSpace();
         GUI.SetNextControlName("chatField");
         chatContent = GUILayout.TextField(chatContent);
         GUILayout.FlexibleSpace();
         GUILayout.EndVertical();
     }
     else
         GUILayout.EndArea();
     GUILayout.EndArea();
     if (focusTField)
     {
         GUI.FocusControl("chatField");
         focusTField = false;
     }
 }
예제 #13
0
    void OnGUI()
    {
        // Show zen count
        //ShadowAndOutline.DrawOutline(new Rect(0, 60, Screen.width, 80), zen.ToString(), zenStyle, Color.white, Color.black, 3);

        // Show words in inventory
        Color tempInColor  = Color.black;
        Color tempOutColor = Color.white;

        if (wordsAlpha == 0)
        {
            tempInColor.a  = 0;
            tempOutColor.a = 0;
        }
        else
        {
            tempInColor.a  = 1;
            tempOutColor.a = 1;
        }


        string[] delims = new string[1];
        delims[0] = "\n";
        string[] newWords = words.Split(delims, System.StringSplitOptions.RemoveEmptyEntries);
        string   output   = string.Join("   ", newWords);

        string[] numKeys = new string[newWords.Length];
        for (int i = 0; i < wordsInventory.Count; i++)
        {
            numKeys[i] = (i + 1).ToString();
        }
        string numOutput = string.Join("            ", numKeys);

        // Display corresponding num keys to switch active words
        ShadowAndOutline.DrawOutline(new Rect(0, Screen.height - 250, Screen.width, 300), numOutput.ToString(), wordsStyle, tempOutColor, tempInColor, 1);

        // Display words
        ShadowAndOutline.DrawOutline(new Rect(0, Screen.height - 200, Screen.width, 300), output.ToString(), wordsStyle, tempOutColor, tempInColor, 1);

        selectorPosition.x  = (Screen.width / 2) - output.Length * 4.8f;
        selectorPosition.x += (120 * (currentSelectorPosition - 1));
        selectorPosition.y  = Screen.height - 80;
        // Display word/power selector
        GUI.DrawTexture(new Rect(selectorPosition.x, selectorPosition.y, 100, 50), wordSelector);


        // Display mouse
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, mouseAlpha);
        GUI.DrawTexture(new Rect((Screen.width / 2) - 8, (Screen.height / 2) - 8, 16, 16), mouseTexture, ScaleMode.ScaleToFit);
    }
예제 #14
0
    void OnGUI()
    {
        // Memory Trigger prompt
        Color inColor  = new Color(Color.black.r, Color.black.g, Color.black.b, promptAlpha);
        Color outColor = new Color(Color.white.r, Color.white.g, Color.white.b, promptAlpha);

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 250, (Screen.height / 2) + 100, 500, 100), "Left Click to activate memory",
                                     promptStyle, outColor, inColor, 1);

        // Show mouse
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, mouseAlpha);

        GUI.DrawTexture(new Rect((Screen.width / 2) - 8, (Screen.height / 2) - 8, 16, 16), mouseTexture, ScaleMode.ScaleToFit);
    }
예제 #15
0
    void DrawPowerMeter()
    {
        Rect powerTextPosition = new Rect(10, Screen.height * .9f, 100, 20);

        ShadowAndOutline.DrawOutline(powerTextPosition, "Power", powerMeterTextStyle, Color.black, Color.white, 2);

        Rect powerContainerPosition = new Rect(50, Screen.height * .9f - powerMeterLength - 10, powerMeterWidth, powerMeterLength);

        GUI.Box(powerContainerPosition, "");

        float powerMeterInteriorLength = powerMeterLength * MainGameCode.currentPower / powerMeterMax;
        float powerMeterInteriorVeritcalPositionAdjustment = powerMeterLength - powerMeterLength * MainGameCode.currentPower / powerMeterMax;

        Rect powerDisplay = new Rect(50, Screen.height * .9f - powerMeterLength + powerMeterInteriorVeritcalPositionAdjustment - 10, powerMeterWidth, powerMeterInteriorLength);

        GUI.Box(powerDisplay, "", powerMeterInteriorStyle);
    }
예제 #16
0
    void DrawAngleSelect()
    {
        Rect angleLablePosition = new Rect(15, 118, 50, 100);

        ShadowAndOutline.DrawOutline(angleLablePosition, "Angle", instructionStyle, Color.black, Color.white, 2);

        Rect angleSelectPosition = new Rect(10, 140, 100, 100);



        GUIContent[] selectionContent = new GUIContent[MainGameCode.engines[MainGameCode.selectedEngine].getAngles().Count];

        for (int counter = 0; counter < MainGameCode.engines[MainGameCode.selectedEngine].getAngles().Count; counter++)
        {
            selectionContent[counter] = new GUIContent(MainGameCode.engines[MainGameCode.selectedEngine].getAngles()[counter].ToString());
        }
        if (MainGameCode.selectedEngine == ENGINE.TREBUCHET)
        {
            MainGameCode.angleSelectNumber = 0;
        }

        MainGameCode.angleSelectNumber = GUI.SelectionGrid(angleSelectPosition, MainGameCode.angleSelectNumber, selectionContent, 1);
    }
예제 #17
0
    void OnGUI()
    {
        Color outColor = Color.black;

        outColor.a = promptAlpha;
        Color inColor = Color.white;

        inColor.a = promptAlpha;

        // Prompt
        GUI.color = new Color(GUI.color.r, GUI.color.b, GUI.color.b, promptAlpha);

        string booktext;

        if (transform.parent.gameObject.name == "Forest: Story 2 Area")
        {
            booktext = "Press E to read the Flight of the Beasts";
        }
        else
        {
            booktext = "Press E to read the Tale of the Golden Mallard";
        }
        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 200, (Screen.height / 2) - 200, 400, 400), booktext, promptStyle, inColor, outColor, 1);
    }
예제 #18
0
    void OnGUI()
    {
        // Show zen count (If applicable)
        if (Application.loadedLevelName != "HouseHub")
        {
            ShadowAndOutline.DrawOutline(new Rect(0, 60, Screen.width, 80), zen.ToString(), zenStyle, Color.white, Color.black, 3);
        }

        // Show words in inventory
        Color tempInColor  = Color.black;
        Color tempOutColor = Color.white;

        if (wordsAlpha == 0)
        {
            tempInColor.a  = 0;
            tempOutColor.a = 0;
        }
        else
        {
            tempInColor.a  = 1;
            tempOutColor.a = 1;
        }


        // Check if you're in the debug 'Sandbox' level
        if (Application.loadedLevelName == "Sandbox")
        {
            // TODO: Set up words when in first-person-exploration mode
            string[] delims = new string[1];
            //delims[0] = " ";
            delims[0] = "\n";
            string[] newWords = words.Split(delims, System.StringSplitOptions.RemoveEmptyEntries);
            string   output   = string.Join("   ", newWords);

            string[] numKeys = new string[newWords.Length];
            for (int i = 0; i < wordsInventory.Count; i++)
            {
                numKeys[i] = (i + 1).ToString();
            }
            string numOutput = string.Join("            ", numKeys);

            // Display corresponding num keys to switch active words
            ShadowAndOutline.DrawOutline(new Rect(0, Screen.height - 250, Screen.width, 300), numOutput.ToString(), wordsStyle, tempOutColor, tempInColor, 1);

            // Display words
            ShadowAndOutline.DrawOutline(new Rect(0, Screen.height - 200, Screen.width, 300), output.ToString(), wordsStyle, tempOutColor, tempInColor, 1);
        }
        else
        {
            ShadowAndOutline.DrawOutline(new Rect((Screen.width) - xOffset, 50, 400, Screen.height), words.ToString(), wordsStyle, tempOutColor, tempInColor, 1);
        }



        // Show mouse
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, crosshairAlpha);

        GUI.DrawTexture(new Rect((Screen.width / 2) - 8, (Screen.height / 2) - 8, 16, 16), mouseTexture, ScaleMode.ScaleToFit);


        //***********************
        // SHOW WORD BUTTON GRID
        //***********************

        // Make the button word grid visible FOR ALL TO SEE AND PONDER ZEEHAHAHAHAHA
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, buttonAlpha);

        buttonStyle           = new GUIStyle(GUI.skin.button);
        buttonStyle.font      = dearJoeFont;
        buttonStyle.fontSize  = buttonFontSize;
        buttonStyle.alignment = TextAnchor.MiddleCenter;
        buttonStyle.wordWrap  = true;

        Vector2 tempBlock = new Vector2(0, 0);

        // Display grid of possible selections
        for (int i = 0; i < wordsInventory.Count; i++)
        {
            if (i > 0)
            {
                //tempBlock.x = Screen.width - 180;// (i + (Screen.width/4));
                tempBlock.y += yInterval;                // (i + (Screen.height/4));
            }
            else
            {
                tempBlock.x = Screen.width - xButtonPosition;
                tempBlock.y = Screen.height - yButtonPosition;
            }

            if (GUI.Button(new Rect(tempBlock.x, tempBlock.y, 140, 60), wordsInventory[i].ToString(), buttonStyle))
            {
                // TODO: Process button selection
                string sceneName   = Application.loadedLevelName;
                string tempWordInv = wordsInventory[i].ToString();

                //**********************
                // HANDLE MATCH PAIRING
                //**********************

                // NOTE: Use unique interaction script to
                // activate any physical movements, etc.

                if (sceneName == "OfficeMemory")
                {
                    // Physical object solutions
                    if (selectedObject == "Water Bottle")
                    {
                        if (tempWordInv == "Water")
                        {
                            GetComponent <Player>().removeWord(i);
                            GetComponent <Player>().zenUp();
                            rightIdea.Play();
                        }
                    }

                    // Character solutions
                    else if (selectedObject == "SadPhil")
                    {
                        if (tempWordInv == "Rage")
                        {
                            GetComponent <Player>().removeWord(i);
                            GetComponent <Player>().zenUp();
                            rightIdea.Play();

                            // Make player move to designated area
                            GetComponent <MaryOfficeInteractions>().startInteraction(selectedObject);
                        }
                    }
                    else if (selectedObject == "PlantManager")
                    {
                        if (tempWordInv == "Pollution")
                        {
                            GetComponent <Player>().removeWord(i);
                            GetComponent <Player>().zenUp();
                            rightIdea.Play();

                            // Make player move to designated area
                            GetComponent <MaryOfficeInteractions>().startInteraction(selectedObject);
                        }
                    }
                }
                else if (sceneName == "IntroductionMemory")
                {
                    if (selectedObject == "SpecialBully")
                    {
                        if (tempWordInv == "Rage")
                        {
                            GetComponent <Player>().removeWord(i);

                            wrongIdea.Play();
                        }
                        else if (tempWordInv == "Happy")
                        {
                            GetComponent <Player>().removeWord(i);
                            GetComponent <Player>().zenUp();

                            rightIdea.Play();
                            levelProgress.currentObstacles++;
                        }
                        else if (tempWordInv == "Compassion")
                        {
                            GetComponent <Player>().removeWord(i);
                            GetComponent <Player>().zenUp();

                            rightIdea.Play();
                            levelProgress.currentObstacles++;
                        }
                    }
                    else if (selectedObject == "SpecialKid")
                    {
                        if (tempWordInv == "Rage")
                        {
                            GetComponent <Player>().removeWord(i);
                            GetComponent <Player>().zenUp();

                            rightIdea.Play();
                            levelProgress.currentObstacles++;
                        }
                        else if (tempWordInv == "Happy")
                        {
                            GetComponent <Player>().removeWord(i);

                            wrongIdea.Play();
                        }
                        else if (tempWordInv == "Compassion")
                        {
                            GetComponent <Player>().removeWord(i);
                            GetComponent <Player>().zenUp();

                            rightIdea.Play();
                            levelProgress.currentObstacles++;
                        }
                    }

                    GetComponent <IntroductionInteractions>().startInteraction(selectedObject, tempWordInv);
                }
            }
        }
    }
예제 #19
0
    void PlayInstructions()
    {
        Rect instructionPosition = new Rect(0, Screen.height * .9f, Screen.width, Screen.height * .10f);

        ShadowAndOutline.DrawOutline(instructionPosition, "left ctrl to show mouse pointer, enter to aim puck\n wasd moves view, mouse looks", instructionStyle, Color.black, Color.white, 2f);
    }
예제 #20
0
    void AimInstructions()
    {
        Rect instructionPosition = new Rect(0, Screen.height * .8f, Screen.width, Screen.height * .10f);

        ShadowAndOutline.DrawOutline(instructionPosition, "arrow keys to turn puck and tilt view, esc to cancel\nhold space to power up, release to fire", instructionStyle, Color.black, Color.white, 2f);
    }
예제 #21
0
    void OnGUI()
    {
        // EXIT MENU
        GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, exitAlpha);
        GUIStyle buttonStyle = new GUIStyle("button");

        buttonStyle.font     = memoryGridFont;
        buttonStyle.fontSize = 16;

        // Exit buttons
        if (GUI.Button(new Rect((Screen.width / 2) - 60, (Screen.height / 2) - 30 - 100, 120, 60), "Continue", buttonStyle))
        {
            exitAlpha = 0;

            // Enable game
            GetComponent <FirstPersonDrifter>().enabled = true;
            GetComponent <MouseLook>().enabled          = true;
            GameObject.Find("Main Camera").GetComponent <HeadBob>().enabled    = true;
            GameObject.Find("Main Camera").GetComponent <MouseLook>().enabled  = true;
            GameObject.Find("Main Camera").GetComponent <CameraZoom>().enabled = true;

            // Hide and lock mouse
            Screen.lockCursor = true;
            Screen.showCursor = false;

            Time.timeScale = 1;

            if (Application.loadedLevelName != "HouseHub" && GetComponent <PlayerGUI>() != null)
            {
                GetComponent <PlayerGUI>().crosshairAlpha = 1;
            }
        }
        if (GUI.Button(new Rect((Screen.width / 2) - 60, (Screen.height / 2) - 30, 120, 60), "Options", buttonStyle))
        {
            // TODO: Options menu
        }
        if (GUI.Button(new Rect((Screen.width / 2) - 60, (Screen.height / 2) - 30 + 100, 120, 60), "Exit", buttonStyle))
        {
            Application.Quit();
        }

        // TITLE
        Color inColor = Color.black;

        inColor.a = exitAlpha;

        Color outColor = Color.white;

        outColor.a = exitAlpha;

        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 50, 0, 100, 400), "The Museum", titleStyle, outColor, inColor, 2);


        // GAME MENU
        inColor    = Color.black;
        outColor   = Color.white;
        inColor.a  = gameMenuAlpha;
        outColor.a = gameMenuAlpha;
        GUI.color  = new Color(GUI.color.r, GUI.color.g, GUI.color.b, gameMenuAlpha);

        // Tabs
        if (GUI.Button(new Rect((Screen.width / 2) - 400, (Screen.height / 2) - 200, 160, 50), GUIContent.none))
        {
            progressionAlpha = 0;
            memoryGridAlpha  = 1;
        }
        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 400, (Screen.height / 2) - 200, 160, 50), "Memories", tabStyle, outColor, inColor, 1.5f);

        if (GUI.Button(new Rect((Screen.width / 2) - 400, (Screen.height / 2) - 140, 160, 50), GUIContent.none))
        {
            memoryGridAlpha  = 0;
            progressionAlpha = 1;
        }
        ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 400, (Screen.height / 2) - 140, 160, 50), "Progress", tabStyle, outColor, inColor, 1.5f);

        // Box
        GUI.Box(new Rect((Screen.width / 2) - 200, (Screen.height / 2) - 200, 512, 512), GUIContent.none);
        GUIStyle gridStyle = new GUIStyle(GUI.skin.button);

        gridStyle.font = memoryGridFont;

        GUI.color  = new Color(GUI.color.r, GUI.color.g, GUI.color.b, memoryGridAlpha);
        inColor.a  = memoryGridAlpha;
        outColor.a = memoryGridAlpha;

        // Memory Grid
        for (int i = 0; i < 3; i++)
        {
            // Button (w/ Item image)
            GUI.Button(new Rect((Screen.width / 2) - 150 + (xOffset * i), (Screen.height / 2) - 150, 100, 100), GUIContent.none, gridStyle);

            // Label
            ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 150 + (xOffset * i), (Screen.height / 2) - 150, 100, 100), "Label", memoryLabelStyle, outColor, inColor, 1);

            for (int j = 1; j < 3; j++)
            {
                GUI.Button(new Rect((Screen.width / 2) - 150 + (xOffset * i), (Screen.height / 2) - 150 + (xOffset * j), 100, 100), GUIContent.none, gridStyle);
                ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 150 + (xOffset * i), (Screen.height / 2) - 150 + (xOffset * j), 100, 100), "Label", memoryLabelStyle, outColor, inColor, 1);
            }
        }

        GUI.color  = new Color(GUI.color.r, GUI.color.g, GUI.color.b, progressionAlpha);
        inColor.a  = progressionAlpha;
        outColor.a = progressionAlpha;

        // Progression Grid
        for (int k = 0; k < (PlayerPrefs.GetInt("LevelsComplete")); k++)
        {
            string level = PlayerPrefs.GetString("Game_TotalProgress");

            if (level[0] == '1')
            {
                // Box
                GUI.Box(new Rect((Screen.width / 2) - 180, (Screen.height / 2) - 180 + (yOffset * k), 470, 128), GUIContent.none);

                // Percentage Label
                ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) - 170, (Screen.height / 2) - 170 + (yOffset * k), 100, 100),
                                             PlayerPrefs.GetInt("Memory_Introduction_PercentageComplete").ToString() + "%", progressionPercentageStyle,
                                             outColor, inColor, 1);

                // Memory Label
                ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) + 60, (Screen.height / 2) - 190 + (yOffset * k), 100, 100), "Prologue: School", progressionNameStyle, outColor, inColor, 1);

                // Painting Progression Label
                ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) + 60, (Screen.height / 2) - 200 + (yOffset * k), 100, 100),
                                             (PlayerPrefs.GetInt("Memory_Introduction_Paintings").ToString()) + "/" + (PlayerPrefs.GetInt("Memory_Introduction_TotalPaintings").ToString()) + " Paintings",
                                             progressionPaintingStyle, outColor, inColor, 1);

                // Obstacle Progression Label
                ShadowAndOutline.DrawOutline(new Rect((Screen.width / 2) + 60, (Screen.height / 2) - 210 + (yOffset * k), 100, 100),
                                             (PlayerPrefs.GetInt("Memory_Introduction_Obstacles").ToString()) + "/" + (PlayerPrefs.GetInt("Memory_Introduction_TotalObstacles").ToString()) + " Obstacles",
                                             progressionObstacleStyle, outColor, inColor, 1);
            }
        }
    }
예제 #22
0
    void PlayInstructions()
    {
        Rect instructionPosition = new Rect(0, Screen.height * .9f, Screen.width, Screen.height * .10f);

        ShadowAndOutline.DrawOutline(instructionPosition, "enter to aim puck\n wasd moves view, q and e rotate", instructionStyle, Color.black, Color.white, 2f);
    }
예제 #23
0
 void OnGUI()
 {
     ShadowAndOutline.DrawOutline(new Rect(10, 10, 100, 50), keyText, keyStyle, Color.white, Color.black, 1);
 }