UnityEngine.AudioSource.Stop C# (CSharp) Method

Stop() private method

private Stop ( ) : void
return void
        public extern void Stop();
        /// <summary>

Usage Example

コード例 #1
0
ファイル: MusicSingleton.cs プロジェクト: TeamTacoCat/DAWG
	void OnLevelWasLoaded(){

		source = GetComponent<AudioSource> ();

		if (GameManager.curScene == "MainMenu") {

			if (source.isPlaying ) {
			
				source.Stop ();
			
			}
			source.clip = songs [0];
			source.Play ();
		
		}else if(GameManager.curScene == "LevelLayout" || GameManager.curScene == "SinglePlayerLevel"){

			//if (source.clip != songs [1]) {
			
			source.Stop ();
			source.clip = songs [Random.Range(1, 3)];
			source.Play ();
			
			//}

		}

	}
All Usage Examples Of UnityEngine.AudioSource::Stop