大约有 24 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0041 秒)
...是Scene2D节点还是2D预制体的根节点,它们的Runtime是没有onStart、onUpdate、onLateUpdate方法的。 注意2:onOpened、onClosed方法是只有Scene2D节点的Runtime有,其它情况是没有的。 3.3 不同的使用UI组件方式 相比自定义的组件脚本,UI组件脚...
来源: Laya3.0_文档 发布时间: 20251010
... 系统部分:通过引擎提供的生命周期方法(如 onEnable、onStart等)或事件方法(如onMouseClick、onKeyDown等)承担系统的逻辑职责,这些方法构成了系统逻辑的执行入口,用于根据组件数据实现具体的行为控制。 这种设计方式将组件...
来源: Laya3.0_文档 发布时间: 20251010
... = 5; 例如,在LayaAir-IDE中增加一个脚本,添加如下代码: onStart(): void { var nType = (window as any).conch.config.getNetworkType(); console.log("network type: " + nType); } 发布Android项目后,测试使用的网络环境为WiFi环境,因此Android Studio控制台打印的...
来源: Laya3.0_文档 发布时间: 20251010
...调、更新回调和结束回调。 启动回调:在缓动开始时,onStart()会被调用,需要注意的是,delay()方法会使缓动延迟开始执行,如果开发者调用了delay()方法,那缓动的启动回调会在延迟结束后执行。 Laya.Tween.create(aSprite).duration(1000)...
来源: Laya3.0_文档 发布时间: 20251010
...h.PI / 180);//把输入的角度值,转成弧度给_radian存起来。 } onStart() { console.log(this._radian); } } 2.4 是否为私有属性(影响面板可见) 除了前文中提到的hidden这个属性标识参数会影响属性在面板上是否可见之外。private参数也会影响属...
来源: Laya3.0_文档 发布时间: 20251010
...Script { private mCurrIndex: number = 0; private mArmature: Laya.Skeleton; onStart() { console.log("Game start"); //加载内置骨骼动画资源 Laya.loader.load("skeleton/Dragon/Dragon.sk").then((templet: Laya.Templet) => { //创建模式为1,可以启用换装 this.mArmature = templet.build...
来源: Laya3.0_文档 发布时间: 20251010
...次 onEnable 组件被启用后执行,比如节点被添加到舞台后 onStart 第一次执行onUpdate之前执行,只会执行一次 onUpdate 每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法 onLateUpdate 每帧更新时执行,在onUpdate之后执...
来源: Laya3.0_文档 发布时间: 20251010
...a.Sprite3D; private rotation: Laya.Vector3 = new Laya.Vector3(0, 0.01, 0); onStart() { Laya.timer.frameLoop(1, this, ()=> { this.cube.transform.rotate(this.rotation, false); }); } } 效果如动图1-4所示: (动图1-4) 1.3 3D节点的进阶使用 @property( { type :Laya.Sprite3D } ) //节...
来源: Laya3.0_文档 发布时间: 20251010
...会执行一次 * 此方法为虚方法,使用时重写覆盖即可 */ onStart(): void { this.camera = this.owner as Laya.Camera; if (this.target) { this.target.transform.position.cloneTo(this.curpos); this.delatpos = new Laya.Vector3(); } } /** * 每帧更新时执行,尽量不要在这里写...
来源: Laya3.0_文档 发布时间: 20251010
...ty( { type: Laya.Box } ) private box: Laya.Box; constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Label字体到box节点下 this.box.addChild( label )...
来源: Laya3.0_文档 发布时间: 20241014