using System.Collections.Generic; using UnityEngine; public class SFXPlayer : MonoBehaviour { public List metal; public List other; internal void Play(RaycastHit hit) { AudioSource component = GetComponent(); component.mute = true; //List list = new List(); //list = ((!hit.rigidbody) ? other : metal); //if (!hit.rigidbody) //{ // component.volume *= 0.5f; //} //component.clip = list[Random.Range(0, list.Count)]; //component.Play(); } }