level 5
天鹅僵梦
楼主
function Start(){
obp=GameObject.FindWithTag("bp");
}
function OnGUI(){
GUI.Window(0,Rect(20,100,200,160),WindowContain,"");//创建一个对话框
}
function WindowContain(windowID:int){
if(GUI.Button(Rect(55,80,50,20),"确认")){
var nbp:GameObject =Instantiate(obp,Vector3(11.75,9.7,10),Quaternion.identity);//生成克隆物体
}
if(GUI.Button(Rect(115,80,50,20),"清空")){//设置清除按钮
Destroy(nbp);//这句有问题吗?为什么删除不了产生出来的克隆物体T T
}
}
原物体是obp,克隆出的物体是nbp
测试过了可以生成克隆物体,可是没法删除!
求大神指教~~
2015年12月10日 13点12分
1
obp=GameObject.FindWithTag("bp");
}
function OnGUI(){
GUI.Window(0,Rect(20,100,200,160),WindowContain,"");//创建一个对话框
}
function WindowContain(windowID:int){
if(GUI.Button(Rect(55,80,50,20),"确认")){
var nbp:GameObject =Instantiate(obp,Vector3(11.75,9.7,10),Quaternion.identity);//生成克隆物体
}
if(GUI.Button(Rect(115,80,50,20),"清空")){//设置清除按钮
Destroy(nbp);//这句有问题吗?为什么删除不了产生出来的克隆物体T T
}
}
原物体是obp,克隆出的物体是nbp
测试过了可以生成克隆物体,可是没法删除!
求大神指教~~