예제 #1
0
    // Called from Animator Events
    public void Step()
    {
        Left = !Left;

        bool grounded = true;

        if (Player != null)
        {
            grounded = Player.Grounded;
        }
        if (grounded)
        {
            int     index = Left ? 0 : 1;
            Vector2 pitch = Left ? PitchA : PitchB;
            StaticHelpers.GetOrCreateCachedAudioSource(Clip, Feet[index].position, Random.Range(pitch.x, pitch.y), Random.Range(Volume.x, Volume.y));
            var dust = StaticHelpers.EmitParticleImpact(Feet[index].position);
            if (dust != null)
            {
                dust.transform.localScale = Vector3.one * 0.2f;
            }
        }
    }