大约有 5 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0035 秒)
...t中使用本地能力 下面是一个推荐做法: //Script.ts @Laya.regClass() class Script extends Laya.Script { wantToUseNode() { EditorEnv.scene.runScript("TestSceneScript.visitNode"); } } //TestSceneScript.ts import fs from "fs"; //注意是IEditorEnv.regClass,不是Laya.regClass!! @IEdito...
来源: Laya3.0_文档 发布时间: 20251010
...的运行时库版本。 代码动态添加的示例如下: const { regClass, property } = Laya; @regClass() export class Demo extends Laya.Script { spine: Laya.Spine2DRenderNode; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void ...
来源: Laya3.0_文档 发布时间: 20251128
...,添加的代码如下: ... import Vector3 = Laya.Vector3; ... export class AnimationScript extends Laya.AnimatorStateScript { ... private model: Laya.Sprite3D; /**@internal */ setPlayScriptInfo(animator: Laya.Animator | Laya.Animator2D, layerindex: number, playstate: Laya.AnimatorState | Laya.A...
来源: Laya3.0_文档 发布时间: 20251010
...码 /** * Based upon https://github.com/bgrins/javascript-astar */ export class AStarFindPath { private terrainSprite: MeshTerrainSprite3D; private layaMonkey: Sprite3D; private path: Vector3[]; private _everyPath: any[]; private _position: Vector3 = new Vector3(0, 0, 0); private _upVector3: Vector3...
来源: Laya3.0_文档 发布时间: 20230303
...意基类必须和预制体根节点类型匹配,一般都是GButton。 class MyItem extends Laya.GButton { //注意!在onConstruct里才可以获取子对象,建议在这里做初始化,不要在构造函数里做初始化 onConstruct() { //this.xx = this.getChild("xx"); //this.xx.on(Laya.E...
来源: Laya3.0_文档 发布时间: 20251128