【发布时间】:2014-10-18 01:22:59
【问题描述】:
使用 UnityEngine; 使用 System.Collections;
公共类 playSound : MonoBehaviour {
private bool destructionHasBegun = false;
public Transform BlueKey;
private void OnTriggerEnter()
{
audio.Play ();
destructionHasBegun = true;
}
private void Update()
{
if(destructionHasBegun)
{
DestroyWhenSoundComplete();
}
}
private void DestroyWhenSoundComplete()
{
if(!audio.isPlaying)
{
Destroy(gameObject);
GameObject textObject = (GameObject)Instantiate(Resources.Load("BlueKey"));
}
}
}
我试图在特定位置实例化 bluekey 预制件,我该怎么做?提前致谢
【问题讨论】:
标签: unity3d