Appearance
变量: globalGameObject
globalGameObject:
any
全局游戏对象,用于暂存GameObject,每帧会刷新,不建议挂在不需要刷新的数据(如果需要在读档时还原类,类请使用ObjClass注册,,类名和注册名需保持一致)
示例
ts
@LM.ObjClass("obj1")
export class obj1 extends LM.GameObject{
private int1 = 0;
init(){
this.int1 = 1
}
update(){
this.int1++;
}
}
LM.globalGameObject.obj1 = new obj1();
LM.globalGameObject.list = [
new obj1(),
new obj1(),
new obj1(),
]