UnityEngine.AudioSource.Play C# (CSharp) Метод

Play() приватный Метод

private Play ( ) : void
Результат void
        public void Play()
        {
            ulong delay = 0L;
            this.Play(delay);
        }

Same methods

AudioSource::Play ( [ delay ) : void

Usage Example

Пример #1
0
	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