本文整理汇总了C#中UnityEngine.AudioClip.LoadAudioData方法的典型用法代码示例。如果您正苦于以下问题:C# AudioClip.LoadAudioData方法的具体用法?C# AudioClip.LoadAudioData怎么用?C# AudioClip.LoadAudioData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.AudioClip
的用法示例。
在下文中一共展示了AudioClip.LoadAudioData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetObjects
public void GetObjects(Sound s) {
string file = s.themeName + "/" + s.stickerName;
S3Client.GetObjectAsync(S3BucketName, file, (responseObj) =>
{
var response = responseObj.Response;
if (response.ResponseStream != null) {
AudioClip t = new AudioClip();
byte[] imageData = new byte[response.ResponseStream.Length];
response.ResponseStream.Read(imageData, 0, (int)imageData.Length);
t.LoadAudioData();
t.name = s.stickerName;
instantiateSounds(t, s);
AudioClip soundInstance = Instantiate(t) as AudioClip;
} else {
Debug.Log("Nothing found in Bucket");
}
});
}
示例2: SlashSound
public static void SlashSound(AudioSource source, AudioClip Slash)
{
Slash.LoadAudioData();
source.clip = Slash;
source.Play();
}
示例3: LoadAndplayClip
public static void LoadAndplayClip(AudioSource source, AudioClip Clip)
{
Clip.LoadAudioData();
source.clip = Clip;
source.Play();
}
示例4: load
IEnumerator load(string songname) {
yield return new WaitForSeconds (0.2f);
ResourceRequest async = Resources.LoadAsync(songname);
if (!async.isDone) {
yield return 0;
}
song = async.asset as AudioClip;
song.LoadAudioData();
}