コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        InputControl.Update();

        switch (currentState)
        {
        case State.PREGAME:
            break;

        case State.INTRO:
            if (lineTimer > 0.0f)
            {
                lineTimer -= Time.deltaTime;
                if (lineTimer <= 0.0f)
                {
                    dialog.currentLine++;

                    if (dialog.IntroDone())
                    {
                        StartGame();
                    }
                    else
                    {
                        lineTimer = lineDelay;
                        HLG_UI.instance.ShowPlayerTextBubble(dialog.GetCurrentIntroLine());
                    }
                }
            }
            break;

        case State.PLAYING:
            if (lineTimer > 0.0f)
            {
                lineTimer -= Time.deltaTime;
                if (lineTimer <= 0.0f)
                {
                    dialog.currentLine++;

                    if (dialog.ConversationDone())
                    {
                        //TODO: figure out what to do here.
                        HLG_UI.instance.HideFollowerTextBubble();
                    }
                    else
                    {
                        lineTimer = lineDelay;

                        if (dialog.currentLine % 2 == 0)
                        {
                            HLG_UI.instance.ShowFollowerTextBubble(dialog.GetCurrentFollowerLine());
                            HLG_UI.instance.HidePlayerTextBubble();
                        }
                        else
                        {
                            HLG_UI.instance.ShowPlayerTextBubble(dialog.GetCurrentFollowerLine());
                            HLG_UI.instance.HideFollowerTextBubble();
                        }
                    }
                }
            }
            break;

        case State.ENDGAME:
            break;
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        InputControl.Update();

        switch (currentState)
        {
        case State.PREGAME:
            break;

        case State.INTRO:
            if (lineTimer > 0.0f)
            {
                lineTimer -= Time.deltaTime;
                if (lineTimer <= 0.0f)
                {
                    dialog.currentLine++;

                    if (dialog.IntroDone())
                    {
                        StartGame();
                    }
                    else
                    {
                        lineTimer = lineDelay;
                        HLG_UI.instance.ShowPlayerTextBubble(dialog.GetCurrentIntroLine());
                    }
                }
            }
            break;

        case State.PLAYING:
            if (lineTimer > 0.0f)
            {
                lineTimer -= Time.deltaTime;
                if (lineTimer <= 0.0f)
                {
                    dialog.currentLine++;

                    if (dialog.ConversationDone())
                    {
                        //TODO: figure out what to do here.
                        HLG_UI.instance.HideFollowerTextBubble();
                    }
                    else
                    {
                        lineTimer = lineDelay;

                        if (dialog.currentLine % 2 == 0)
                        {
                            HLG_UI.instance.ShowFollowerTextBubble(dialog.GetCurrentFollowerLine());
                            HLG_UI.instance.HidePlayerTextBubble();

                            //If it's the last line, end the awkward
                            if (dialog.currentLine == dialog.followerConversations [dialog.currentConversation].lines.Length - 1)
                            {
                                follower.StopFollowing();

                                awkwardLevel = 1.0f;

                                HLG_UI.instance.SetAwkwardMeterFill(0.0f);
                                HLG_UI.instance.UpdateAwkwardMultiLabel(awkwardLevel);

                                DOTween.Kill(HLG_UI.instance.awkwardMeter.transform);
                            }
                            else
                            {
                                currentAwkwardStep++;

                                UpdateAwkwardLevel();
                            }
                        }
                        else
                        {
                            HLG_UI.instance.ShowPlayerTextBubble(dialog.GetCurrentFollowerLine());
                            HLG_UI.instance.HideFollowerTextBubble();
                        }
                    }
                }
            }

            break;

        case State.GRENADE:
            if (scoreTimer > 0.0f)
            {
                scoreTimer -= Time.deltaTime;

                if (scoreTimer <= 0.0f)
                {
                    EndGame();
                }
            }
            break;

        case State.ENDGAME:
            break;
        }
    }