예제 #1
0
    /// <summary>
    /// waits a second, animates text in and turns the player on before starting the move icon blinking coroutine
    /// </summary>
    IEnumerator startBuffer()
    {
        yield return(new WaitForSeconds(startBufferTime));

        animateTextScript.AnimateNewText(storyText[0]);
        yield return(new WaitForSeconds(playerInvisibleTime));

        player.GetComponent <SpriteRenderer>().enabled = true;
        player.GetComponent <MovePlayer>().canMove     = true;
        audio.PlayOneShot(playerAppearSound);

        yield return(new WaitForSeconds(timeBeforeMovePrompt));

        StartCoroutine(BlinkMovePrompt());
    }
예제 #2
0
파일: ChatMenu.cs 프로젝트: apkd/snas
    public void Update()
    {
        if (Input.GetKeyDown(KeyCode.Keypad0))
        {
            visible    ^= true;
            linesFrozen = lines;

            menuText.enabled = visible;
            menuText.text    = string.Join(
                separator: "\n",
                values: linesFrozen.Select(
                    (x, i) => $"<b>{i + 1}</b>| {x}"
                    )
                );
        }

        if (Input.GetKeyDown(KeyCode.Keypad1))
        {
            AnimateText(1);
        }

        if (Input.GetKeyDown(KeyCode.Keypad2))
        {
            AnimateText(2);
        }

        if (Input.GetKeyDown(KeyCode.Keypad3))
        {
            AnimateText(3);
        }

        if (Input.GetKeyDown(KeyCode.Keypad4))
        {
            AnimateText(4);
        }

        if (Input.GetKeyDown(KeyCode.Keypad5))
        {
            AnimateText(5);
        }

        if (Input.GetKeyDown(KeyCode.Keypad6))
        {
            AnimateText(6);
        }

        if (Input.GetKeyDown(KeyCode.Keypad7))
        {
            AnimateText(7);
        }

        if (Input.GetKeyDown(KeyCode.Keypad8))
        {
            AnimateText(8);
        }

        if (Input.GetKeyDown(KeyCode.Keypad9))
        {
            AnimateText(9);
        }

        if (Input.GetKeyDown(KeyCode.Backspace))
        {
            animateText.StopAnimating();
        }

        void AnimateText(int index)
        {
            animateText.AnimateNewText(linesFrozen[index - 1]);
            visible          = false;
            menuText.enabled = visible;
        }
    }