Ejemplo n.º 1
0
    private static void HandleInput(AnimatorManager animatorManager)
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            animatorManager.CrossfadeAnimator("talking", 0.1f, -1);
        }

        if (Input.GetKeyDown("1"))
        {
            // This animation is very long so it looks like it is stuck in this state,
            // but it is not.
            animatorManager.PlayOnce("sitting_talking", 0.1f, -1);
        }

        if (Input.GetKeyDown("2"))
        {
            animatorManager.PlayOnce("Walk", 0.1f, -1);
        }

        if (Input.GetKeyDown("3"))
        {
            animatorManager.PlayOnce("Run", 0.1f, -1);
        }

        if (Input.GetKeyDown("4"))
        {
            animatorManager.PlayOnce("Afraid", 0.1f, -1);
        }

        if (Input.GetKeyDown("5"))
        {
            animatorManager.PlayOnce("Happy", 0.1f, -1);
        }

        if (Input.GetKeyDown("6"))
        {
            animatorManager.PlayOnce("Sad", 0.1f, -1);
        }

        if (Input.GetKeyDown("7"))
        {
            animatorManager.PlayOnce("Surprise", 0.1f, -1);
        }

        if (Input.GetKeyDown("8"))
        {
            animatorManager.PlayOnce("Angry", 0.1f, -1);
        }

        if (Input.GetKeyDown("9"))
        {
            animatorManager.PlayOnce("Cubeintro", 0f, -1);
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            ApplicationManager.Instance.ChangeCoach();
        }

        if (Input.GetKeyDown(KeyCode.B))
        {
            ApplicationManager.Instance.ChangeBackground();
        }

        if (Input.GetKeyDown(KeyCode.K))
        {
            ApplicationManager.Instance.WalkAway();
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            ApplicationManager.Instance.WalkBack();
        }

        if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.W))
        {
            animatorManager.CrossfadeAnimator("Walk", 0.05f, -1);
        }
        if (Input.GetKeyUp(KeyCode.UpArrow) || Input.GetKeyUp(KeyCode.W))
        {
            animatorManager.CrossfadeAnimator("idle", 0.2f, -1);
        }

        // Press R to reset the position and rotation of the avatar.
        if (Input.GetKeyDown(KeyCode.R))
        {
            ApplicationManager.Instance.ResetPosition();
        }
    }