本文整理汇总了C#中UnityEngine.AudioSource.PlayDelayed方法的典型用法代码示例。如果您正苦于以下问题:C# AudioSource.PlayDelayed方法的具体用法?C# AudioSource.PlayDelayed怎么用?C# AudioSource.PlayDelayed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.AudioSource
的用法示例。
在下文中一共展示了AudioSource.PlayDelayed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AudioPlayer
public AudioPlayer(AudioObject audio)
{
if (audio == null || audio.parent == null)
{
removable = true;
return;
}
this.finished = false;
this.removable = false;
this.paused = false;
this.audio = audio;
// create audio source with clip
audioGO = (GameObject)GameObject.Instantiate(AudioManager.instance.audioSourcePrefab);
//Debug.Log(audio.parent);
audioGO.transform.parent = audio.parent.transform;
audioGO.transform.localPosition = Vector3.zero;
SoundSystemManager.HandleAudioSource(audioGO);
audioAS = audioGO.GetComponent<AudioSource>();
audioAS.Stop();
audioAS.clip = audio.clip;
audioAS.volume = audio.volume;
audioAS.loop = audio.loop;
if (audio.maxDistance.HasValue)
audioAS.maxDistance = audio.maxDistance.Value;
if (audio.minDistance.HasValue)
audioAS.minDistance = audio.minDistance.Value;
playAtTime = Time.time + audio.delay;
audioAS.PlayDelayed(audio.delay);
}
示例2: Start
// Use this for initialization
void Start()
{
_exterminate = GetComponent<AudioSource>();
_exterminate.pitch += Random.Range(-0.1F, 0.8F);
_speakingFrequency = Random.Range(2F, 5F);
_exterminate.PlayDelayed(_speakingFrequency);
}
示例3: Start
// Use this for initialization
void Start()
{
musicSrc = transform.FindChild("Music").GetComponent<AudioSource>();
ambienceSrc = transform.FindChild("Ambience").GetComponent<AudioSource>();
onPuzzleCompletionSrc = transform.FindChild("OnPuzzleCompletion").GetComponent<AudioSource>();
if(playMusicDelay != 0f)
musicSrc.PlayDelayed(playMusicDelay);
}
示例4: Start
// Use this for initialization
void Start()
{
audio1 = GetComponent<AudioSource>();
audio1.PlayDelayed(Random.Range(0F, 3.0F));
audio1.pitch = audio1.pitch + Random.Range(-3F, 3.0F);
x = transform.position.x;
y = transform.position.y;
z = transform.position.z;
}
示例5: LoadClip
public static IEnumerator LoadClip(AudioSource audioSource)
{
WWW www = new WWW("file://" + tempFolder + "output.wav");
while (!www.isDone)
yield return www;
AudioClip clip = www.GetAudioClip(false);
audioSource.clip = clip;
if (clip.length > 0)
audioSource.PlayDelayed(0.02f);
}
示例6: Start
// Use this for initialization
void Start()
{
//audio.PlayDelayed(5);
audioinicio = (AudioSource)gameObject.AddComponent ("AudioSource");
AudioClip myAudioClip;
audioinicio.clip = audiofile;
audioinicio.loop = false;
audioinicio.PlayDelayed (3);
}
示例7: Start
// Use this for initialization
void Start ()
{
sfx = variety[Random.Range(0, variety.Length)];
sfx.PlayDelayed(0.3f);
Destroy(gameObject, 1.0f);
}
示例8: TurnSound
void TurnSound ( AudioSource sound, float pitchRange, float avgRateEst, float rateMax, float accel ) {
if ( avgRateEst > accel * .03f ) {
if ( sound.isPlaying == false ) {
sound.PlayDelayed(.1f);
}
sound.pitch = 1f + (( (avgRateEst - (rateMax * .5f)) / rateMax ) * (pitchRange * 2f));
} else {
sound.Stop();
}
}
示例9: Awake
// Use this for initialization
void Awake()
{
briefingVO = gameObject.GetComponent<AudioSource>();
briefingVO.PlayDelayed(1.5f);
}
示例10: LoadAudioClipAndPlayDelayed
AudioSource LoadAudioClipAndPlayDelayed( AudioSource source , string audioPath , float vol , float xchbgmTime , bool loop ){
AudioClip clip = Resources.Load( audioPath ) as AudioClip;
source.clip = clip;
source.volume = vol;
source.loop = loop;
source.PlayDelayed ( xchbgmTime );
return source;
}
示例11: Start
// Use this for initialization
void Start()
{
entryDoorAudioSource = GetComponent<AudioSource> ();
entryDoorAudioSource.PlayDelayed (2f);
}
示例12: PlayClip
private void PlayClip(AudioSource a_source, AudioClip clip, float delay, float start_time, float volume, float pitch)
{
a_source.clip = clip;
a_source.time = start_time;
a_source.volume = volume;
a_source.pitch = pitch;
#if !UNITY_3_5 && !UNITY_4_0
a_source.PlayDelayed(delay);
#else
a_source.Play((ulong)( delay * 44100));
#endif
}
示例13: play
private IEnumerator play(AudioSource audioSource, float delay = 0f)
{
audioSource.PlayDelayed(delay);
yield return new WaitForSeconds (audioSource.clip.length);
Destroy (audioSource);
}
示例14: Start
void Start()
{
src = GetComponent<AudioSource>();
src.clip = c0;
src.PlayDelayed(2);
dni = true;
b0 = true;
}
示例15: Start
// Use this for initialization
void Start () {
audioSource = GetComponent<AudioSource>();
audioSource.clip = mooSounds[ Random.Range(0,mooSounds.Length-1)];
audioSource.PlayDelayed(mooDelay);
}