// Use this for initialization void Start() { this.soundSys = GameObject.FindObjectOfType <PhysicsSoundSystem>(); this.audioSource = this.gameObject.GetComponent <AudioSource>(); audioSource.volume = 0.6f; this.audioSource.playOnAwake = false; filter = gameObject.AddComponent <AudioLowPassFilter>(); filter.cutoffFrequency = 1000; }
// Use this for initialization void Start() { this.soundSys = GameObject.FindObjectOfType <PhysicsSoundSystem>(); var audioStuff = new GameObject(); audioStuff.transform.parent = this.transform; this.audioSource = audioStuff.AddComponent <AudioSource>(); //audioSource.volume = 0.6f; this.audioSource.playOnAwake = false; filter = audioStuff.AddComponent <AudioLowPassFilter>(); filter.cutoffFrequency = 1000; this.rb = gameObject.GetComponent <Rigidbody>(); }
void Awake() { instance = this; }