BBGamelib.SimpleAudioEngine.Awake C# (CSharp) Method

Awake() public method

public Awake ( ) : void
return void
		public virtual void Awake() {
			if (_Instance != null && _Instance != this) {
				Destroy (this.gameObject);
				return;
			} else {
				_Instance = this;
			}
			if (Application.isPlaying) {
				_backgroundMusicVolume = 1;
				_effectsVolume = 1;
				_currentSource = 0;
			} 
			if (firstPassFlag) {
				gameObject.transform.position = Vector3.zero;
				gameObject.name = "AudioEngine";
				firstPassFlag = false;
				
				_backgroundMusicSource = gameObject.AddComponent<AudioSource>();
				_audioSources = new AudioSource[AUDIO_SOURCES_NUM];
				for(int i=0; i<AUDIO_SOURCES_NUM; i++)
					_audioSources[i] = gameObject.AddComponent<AudioSource>();
			}
		}
		#endregion