作者:Fuckkkkkkkkkk7777_352 | 来源:互联网 | 2022-12-25 10:38
functiononBtn(Flags,X,Y){varretSGWorld.Window.PixelToWorld(X,Y,1|8192);if(ret.Objec
function onBtn(Flags, X, Y){
var ret = SGWorld.Window.PixelToWorld(X, Y,1|8192);
if(ret.ObjectID!=""){ //选中了模型或者3dml中单体模型
var obj=SGWorld.Creator.GetObject(ret.ObjectID);
if(obj){
if(obj.ObjectType==33){
if(currentSelectObj == null){
currentSelectObj = obj;
}else{
currentSelectObj.Terrain.Tint.abgrColor=0x00000000;
currentSelectObj=null;
}
obj.Tint.abgrColor=0xff0000ff;
}
}
}else{
if(currentSelectObj!=null)
{
if(currentSelectObj.ObjectType==17)
{
currentSelectObj.Terrain.Tint.abgrColor=0x00000000;
currentSelectObj=null;
}
else if(currentSelectObj.ObjectType==33)
{
currentSelectObj.Tint.abgrColor=0x00000000;
currentSelectObj=null;
}
}
}
SGWorld.DetachEvent("onLButtonDown", onBtn);
return false;
}