[LayaNative 2.0]为什么全局属性赋值后,在另外个函数中调用会自动变成undefined
public class MainPageController extends Scene {
public var camera:Camera;
public function MainPageController(){
super();
Laya.stage.scaleMode = Stage.SCALE_FULL;
Laya.stage.screenMode = Stage.SCREEN_NONE;
Scene3D.load("res/model/LayaScene_Car/Conventional/car.ls", Handler.create(null, function(scene:Scene3D):void {
Laya.stage.addChild(scene) as Scene3D;
camera = scene.getChildByName("Main Camera") as Camera;
Laya.stage.on(Event.MOUSE_DOWN, this, onMouseDown);
trace(camera);
}))
}
public function onMouseDown():void {
trace(camera);
}
}
代码如上 AS3语言
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复