大约有 178 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0037 秒)
...对象 const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { let item1 = Laya.Pool.createByClass(TestClass); console.log('item1:', item1.type); Laya.Pool.recoverByClass(item1); let item2 = Laya.Pool.createByClass(TestClass2); console.log('item2:', item2...
来源: Laya_社区 发布时间: 20250819
... • 2018-10-25 14:56 写一个ts文件,写上 export default class Move extends Laya.Script{ /** @prop {name:target,tips:"目标容器",type:Prefab}*/ targetPrefab:Laya.Prefab; } 将文件在编辑模式下赋给点添加组件=》code=》move 然后创建一个box拖为预制体 放在...
来源: Laya_社区 发布时间: 20181025
...类似如下代码: module ui.coreUI { export class TestUI extends View{ // do something... } } 我在其它包的类中通过 import TestUI = ui.coreUI.TestUI ; 方式引入类 定义时报错: "Uncaught ReferenceError: ui is not defined" ...
来源: Laya_社区 发布时间: 20170424
...0110110110@qq.com * @ data: 2022-04-09 15:53 */ export default class fruit extends Laya.Script { static Fru:fruit; public rope:Laya.RopeJoint constructor() { super(); fruit.Fru=this; } onAwake() { let rig:Laya.RigidBody=t...
来源: Laya_社区 发布时间: 20220413
...例化 laya.ani.bone.Skeleton 对象报错 export default class showSpine extends Laya.Script{ constructor() { super(); //创建一个Skeleton对象 //Laya let skeleton: laya.ani.bone.Skeleton = new laya.ani.bone.Skeleton(); } } 实例化报错 为啥 2018-09-28 添加评论 免费帖 --> 分享 微...
来源: Laya_社区 发布时间: 20180928
... const { regClass, property } = Laya; @regClass() export class Animation extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Animation }) //在IDE面板中显示属性 ani: Laya.Animation; constructor() { super(); } //组件被激活后执行,此时所有节点和组件...
来源: Laya3.0_文档 发布时间: 20251010
...ntroller.js import wxHelper from 'wxhelper' export default class welcome extends Laya.Script { constructor() { super() } onEnable() { wxHelper.onShow(this.resumeGame) wxHelper.onHide(this.pauseGame) } resumeGame () { console.log('resumeGame') } pauseGame () { console.log('pauseGame') } onDestroy (...
来源: Laya_社区 发布时间: 20181101
...无法触发onTriggerEnter, export default class BulletControlTrigger extends Laya.Script3D { constructor(){ super(); } /** * 开始触发时执行 * 此方法为虚方法,使用时重写覆盖即可 */ onTriggerEnter(other){ console.log("onTriggerEnter"); }; onTriggerStay(other){ console...
来源: Laya_社区 发布时间: 20191215
...t { regClass, property } = Laya; @regClass() export class TextInputControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextInput } ) public txtin: Laya.TextInput; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建...
来源: Laya3.0_文档 发布时间: 20251010
...按钮绑定一个btn1.js 我在这样写的 export default class btn1 extends Laya.Script { constructor(){ alert("1"); //执行后这里触发了 super();} onEnable(){ alert("2"); //执行后这里触发了 } onclick(){ alert("3"); //执行后点击按钮这里没触发,不知道为什么 //La...
来源: Laya_社区 发布时间: 20181028