void ModifyProperty(AudioSourcePropertyType pt, float value) { switch(pt) { case AudioSourcePropertyType.Pitch: audio.pitch = value; break; case AudioSourcePropertyType.Spread: audio.spread = value; break; case AudioSourcePropertyType.Volume: audio.volume = value; break; } }
void ModifyProperty(AudioSourcePropertyType pt, float value) { switch (pt) { case AudioSourcePropertyType.Pitch: GetComponent <AudioSource>().pitch = value; break; case AudioSourcePropertyType.Spread: GetComponent <AudioSource>().spread = value; break; case AudioSourcePropertyType.Volume: GetComponent <AudioSource>().volume = value; break; } }