Пример #1
0
    public IEnumerator StartRandomGame()
    {
        optionBox.playerChoice = 0;
        ClickHandler.Active    = false;

        yield return(new WaitForSeconds(1f));

        SoundHandler.sound.Play(SoundHandler.sound.m);
        var t = SoundHandler.sound.m.length;

        if (isSkipMode)
        {
            skipButtonScript.PopupSkipButton(t);
        }
        while (t >= 0)
        {
            if (Skip)
            {
                Skip = false;
                t    = 1;
            }

            t -= Time.deltaTime;
            yield return(null);
        }

        optionBox.PopupOptionBox("WHAT DO YOU WANT TO DO?", "TELL HIM", "REMAIN SILENT");
        while (optionBox.playerChoice == 0)
        {
            yield return(null);
        }

        StoryHandler.saidName  = optionBox.playerChoice == 1;
        optionBox.playerChoice = 0;

        if (StoryHandler.saidName)
        {
            DatabaseHandler.PostVariableToDatabase(1, "saidName");
            SoundHandler.sound.Play(SoundHandler.sound.na);
            var t1 = SoundHandler.sound.na.length;
            if (isSkipMode)
            {
                skipButtonScript.PopupSkipButton(t1);
            }
            while (t1 >= 0)
            {
                if (Skip)
                {
                    Skip = false;
                    t1   = 1;
                }

                t1 -= Time.deltaTime;
                yield return(null);
            }
        }
        else
        {
            DatabaseHandler.PostVariableToDatabase(1, "nSaidName");
            SoundHandler.sound.Play(SoundHandler.sound.nb);
            var t2 = SoundHandler.sound.nb.length;
            if (isSkipMode)
            {
                skipButtonScript.PopupSkipButton(t2);
            }
            while (t2 >= 0)
            {
                if (Skip)
                {
                    Skip = false;
                    t2   = 1;
                }

                t2 -= Time.deltaTime;
                yield return(null);
            }
        }

        SoundHandler.sound.Play(SoundHandler.sound.o);
        var t3 = SoundHandler.sound.o.length;

        if (isSkipMode)
        {
            skipButtonScript.PopupSkipButton(t3);
        }
        while (t3 >= 0)
        {
            if (Skip)
            {
                Skip = false;
                t3   = 1;
            }

            t3 -= Time.deltaTime;
            yield return(null);
        }

        infoBox.PopupInfoBox("TRY DRAGGING THE BLOCKS TO THE LIGHT", 5);
        giveUpButtonScript.PopdownGiveUpButton();
        onFirstPuzzle       = true;
        ClickHandler.Active = true;
    }