AudioSource.clip 剪辑

var clip : AudioClip

Description描述

The default AudioClip to play

默认播放的音频剪辑。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public AudioClip otherClip;
	IEnumerator Awake() {
		audio.Play();
		yield return new WaitForSeconds(audio.clip.length);
		audio.clip = otherClip;
		audio.Play();
	}
}
var otherClip: AudioClip;

// Play default sound
//播放默认的声音
audio.Play();

// Wait for the audio to have finished
//等待音频完成
yield WaitForSeconds (audio.clip.length);

// Assign the other clip and play it
//分配其他剪辑并播放
audio.clip = otherClip;
audio.Play();
Page last updated: 2011-4-5