大约有 14 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0043 秒)
...是Scene2D节点还是2D预制体的根节点,它们的Runtime是没有onStart、onUpdate、onLateUpdate方法的。 注意2:onOpened、onClosed方法是只有Scene2D节点的Runtime有,其它情况是没有的。 3.3 不同的使用UI组件方式 相比自定义的组件脚本,UI组件脚...
来源: Laya3.0_文档 发布时间: 20251010
...ss, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { console.log("Game start"); } } 2.2 场景的脚本说明 前面讲了项目的入口, 本小节简述一下场景的脚本。场景的脚本主要是两类, 一类是自定义的组件脚本。这种脚本,...
来源: Laya3.0_文档 发布时间: 20251103
...会执行一次 * 此方法为虚方法,使用时重写覆盖即可 */ 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
...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
...ss, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { alert(testLib.nativeAdd(10, 11)); } } 因为LayaNative的扩展功能只支持Windows平台,所以只能通过Windows预览或发布为Windows项目才能得到正确的结果。运行效果如图3-2所示, ...
来源: Laya3.0_文档 发布时间: 20251010
...xport class Main extends Laya.Script { private aStarInstance: AStarFinder; onStart() { console.log("Game start"); // 0表示通路,1表示障碍 let myMatrix = [ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0], [1, 1,...
来源: 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
...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_文档 发布时间: 20251105
...0); img.skin = "resources/layabox.png"; //纹理压缩的图片的路径 } onStart() { Laya.Stat.show(0, 0); //性能面板 } } 发布后,使用的图片就是压缩后的图片了。 3.2 图集纹理压缩的加载 对于2D图集,预加载图集atlas文件即可,引擎在加载图集的时候...
来源: Laya3.0_文档 发布时间: 20251010