PlayerScript.ReceiveStepEvent C# (CSharp) Méthode

ReceiveStepEvent() private méthode

private ReceiveStepEvent ( Vector3 localDirection ) : void
localDirection Vector3
Résultat void
    private void ReceiveStepEvent(Vector3 localDirection)
    {
        const float exteriorScale = 0.94f;
        const float interiorScale = 0.40f;
        float scale = CameraScript.IsExteriorView ? exteriorScale : interiorScale;
        CameraScript.AddYSpringImpulse(localDirection.z * scale);

        // TODO super gross wtf is wrong with me
        bool isStrafing = currentAnim == "strafeLeft" || currentAnim == "strafeRight";

        // Don't stick more in if too many already
        if (FootstepThrottler.Items.Count > 1) return;
        if (localDirection.z > 0)
        {
            FootstepThrottler.Add(() =>
            {
                StepSound.pitch = 0.9f;
                StepSound.volume = 0.18f;
            if (GlobalSoundsScript.soundEnabled)
                StepSound.Play();
            });
        }
        else if (!isStrafing)
        {
            FootstepThrottler.Add(() =>
            {
                StepSound.volume = 0.06f;
                StepSound.pitch = 0.8f;
            if (GlobalSoundsScript.soundEnabled)
                StepSound.Play();
            });
        }
    }
}