Version: 5.6
public void Play (ulong delay= 0);

파라미터

delay Delay in number of samples, assuming a 44100Hz sample rate (meaning that Play(44100) will delay the playing by exactly 1 sec).

설명

Plays the clip with an optional certain delay.

The delay parameter is deprecated, please use the newer PlayDelayed function instead which specifies the delay in seconds.

Note: To obtain sample accuracy with an AudioClip with a different samplerate (than 44.1 khz) you have to do the math yourselves. Delaying an audiosource with an attached AudioClip with samplerate of, say, 32 khz, with 16k samples(.5 sec) is done by Play(22050). ((44100/32000) * 16000 = 22050).

Note: The AudioSource.PlayScheduled API will give you more accurate control over when the audio clip is played.

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(AudioSource))] public class ExampleClass : MonoBehaviour { void Start() { AudioSource audio = GetComponent<AudioSource>(); audio.Play(); audio.Play(44100); } }

See Also: Stop, Pause, clip and PlayScheduled functions.