UnityEngine.AudioSource.Play C# (CSharp) Method

Play() private method

private Play ( ) : void
return void
        public void Play()
        {
            ulong delay = 0L;
            this.Play(delay);
        }

Same methods

AudioSource::Play ( [ delay ) : void

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::Play