Skip to content

格式

typescript
Scene.IsGameObjectExists(go)

所属类: Scene

描述

判断当前场景是否存在指定游戏对象。

参数

参数名类型描述
goGameObject游戏对象

返回值

类型描述
boolean是否存在指定游戏对象

代码示例

typescript
 const scene = SceneManager.CreateScene("test"); 
 const obj = new GameObject("test1");   
 const exist:boolean = scene.IsGameObjectExists(obj);