void Awake()
    {
        defaultMat = materials[0];

        dict = new Dictionary<PhysicMaterial, MaterialImpact> ();
        for (int i = 0; i < materials.Length; i++) {
            dict.Add (materials[i].physicMaterial, materials[i]);
        }
    }
    void Awake()
    {
        defaultMat = materials[0];

        dict = new Dictionary <PhysicMaterial, MaterialImpact> ();
        for (int i = 0; i < materials.Length; i++)
        {
            dict.Add(materials[i].physicMaterial, materials[i]);
        }
    }
    public static AudioClip GetBulletHitSound(PhysicMaterial mat)
    {
        MaterialImpact imp = GetMaterialImpact(mat);

        return(GetRandomSoundFromArray(imp.bulletHitSounds));
    }
    public static AudioClip GetSpiderFootstepSound(PhysicMaterial mat)
    {
        MaterialImpact imp = GetMaterialImpact(mat);

        return(GetRandomSoundFromArray(imp.spiderFootstepSounds));
    }