大约有 9 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0047 秒)
...Laya.Script命名函数方式处理输入。例如: this.aNode.on(Laya.Event.CLICK, ()=> { console.log("clicked"); }); class MyScript extends Laya.Script { //脚本事件 onMouseClick(e:Event) { console.log("clicked"); } } aNode.addComponent(MyScript); 以上两种方式是等价的,且在纯...
来源: Laya3.0_文档 发布时间: 20251010
...ton}) public initBtn: Laya.Button; onEnable(): void { this.initBtn.on(Laya.Event.CLICK, this.onInit); } onInit() { alert(extendLib.initializeSteam()); } } 构建发布Windows后,需要在exe的同级目录下,新建一个steam_appid.txt 文件,其中只包含 AppID。 (图2-2) 在Steam客...
来源: Laya3.0_文档 发布时间: 20251010
...nt, url);// 此处最好加延迟 //监听器注册 Laya.Browser.window.addEventListener("click", (event: any) => { console.log(event.type); }) Window.open() 方法、window.postMessage()方法、Window.addEventListener()方法 3.3 container 画布 LayaAir引擎里可以通过 Laya.Browser.contai...
来源: Laya3.0_文档 发布时间: 20251010
...ions", inspector: "Buttons", options : { buttons : [ { caption : "点我", event: "my_click" } ] } } ] } ]); this._panel.allowUndo = true; //根据需要设置 //如果不需要undo功能,也可以直接this._data = {}; this._data = IEditor.DataWatcher.watch({}); //inspect可以多次调用,将...
来源: Laya3.0_文档 发布时间: 20251010
...侦听器,而是直接侦听列表的ClickItem事件: list.on(Laya.UIEvent.ClickItem, this, this.onClickItem); // 回调函数的第一个参数就是当前被点击的对象 function onClickItem(item: GObject): void { console.log("点击了对象:" + item.title); //获得这个对象在列表...
来源: Laya3.0_文档 发布时间: 20251128
...完毕,此方法只执行一次 */ onAwake(): void { this.uiBtn.on(Laya.Event.CLICK, this, () => { //点击后,打开Msg场景 Laya.Scene.open("Msg.ls", false, { "text": "点击成功!" }); }); } } 其中,Scene场景有一个Button组件,需要在IDE中,将其拖入到@property暴露...
来源: Laya3.0_文档 发布时间: 20251010
... 记录当前皮肤状态 //播放停止后执行逻辑 this.owner.on(Laya.Event.STOPPED, this, () => { // 通过三元运算符切换皮肤名称 currentSkin = currentSkin === "full-skins/girl" ? "full-skins/girl-blue-cape" : "full-skins/girl"; this.spine.skinName = currentSkin; this.spine.play(...
来源: Laya3.0_文档 发布时间: 20251128
...mpents(this._allAgent, sprite.scene, Nav2DAgent); } onMouseClick(evt: Laya.Event): void { let pos = new Laya.Vector2(evt.stageX, evt.stageY); console.log("click", pos); this._temp.graphics.clear(); this._allAgent.forEach((agent) => { agent.destination = pos; let paths = agent.getCurrentPath(); if...
来源: Laya3.0_文档 发布时间: 20251010
...prite3D; private animator : Laya.Animator; onStart() { this.label.on( Laya.Event.CLICK, this, this.test ); //获得状态机 this.animator = this.target.getComponent<Laya.Animator>(Laya.Animator); } //运行状态机的跑动画,可使用动作融合方式 test(e: Laya.Event) { //动画状...
来源: Laya3.0_文档 发布时间: 20251010