Sync footstep sounds with collider materials

A character with the Footstep Sounds component will play walk and run sounds as they move around the scene. These sounds can be changed using the "Sound: Change footsteps" Action, placed in e.g. a Trigger. This script, however, allows you to change sounds automatically based on what surface the character is standing on.

To use:


 * 1) For each floor collider that can be stood on, create and assign it a Unity "Physic Material" asset.
 * 2) Create a new C# file named AutoSetFootstepSounds.cs, and paste in the code below.
 * 3) Attach the new Auto Set Footstep Sounds component to your character.
 * 4) Fill in the component's Inspector: assigning both the layer that the floor colliders are placed on, and create an entry for each created Physic Material in the "Footstep Materials" array, pairing the material with a set of footstep sounds.

AutoSetFootstepSound.cs: