void Update()
    {
        if (!performance.GetSequence().IsComplete())
        {
            foreach (KeyValuePair <KeyCode, DollDanceSequence.Move> entry in inputMap)
            {
                KeyCode input = entry.Key;
                DollDanceSequence.Move selectedMove = entry.Value;

                if (Input.GetKeyDown(input))
                {
                    DollDanceSequence.Move move = performance.GetSequence().Process(selectedMove);
                    if (move == DollDanceSequence.Move.Idle)
                    {
                        performance.Perform(selectedMove);
                        performance.Fail();
                    }
                    else
                    {
                        performance.Perform(move);
                    }
                }
            }
        }
        else
        {
            performance.Succeed();
        }
    }
Exemplo n.º 2
0
    public void Perform(DollDanceSequence.Move move)
    {
        // Doll does a move
        animator.SetTrigger(move.ToString());

        dollSource.Stop();
        dollSource.pitch = pitchMap[move];
        dollSource.PlayOneShot(dollClip);
    }
Exemplo n.º 3
0
    void Point(DollDanceSequence.Move move)
    {
        // Point, look, play a sound
        animator.Play(move.ToString(), POINT_LAYER);
        //animator.Play(move.ToString(), EYE_LAYER);

        playEyeAnimation(move.ToString());

        pointSource.pitch = pitchMap[move];
        pointSource.PlayOneShot(pointClip);
    }