大约有 13 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0056 秒)
... ```typescript //单模块 declare module '*.glsl' { const value: string; export default value; } declare module CANNON { //在声名的模块里定义类型 export class Demo { constructor( options: Object ); addScene( title: string, initfunc: Function ): void; restartCurrentScene(): void; } } //...
来源: Laya2.0_文档 发布时间: 20210715
...ass(),示例代码如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 1.2 IDE中如何找到被识别的组件脚本 只有使用了@regClass()装饰器标识,才会被LayaAir3-IDE识别为自定义组件脚本,可以被节点(实体)所添加...
来源: Laya3.0_文档 发布时间: 20251010
...,脚本内容如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): v...
来源: Laya3.0_文档 发布时间: 20251010
...2.0的版本开始,我用ts编写的相关内容,都要使用import和export吗? 【带附件】 使用Laya2.0.0beta5.1 发布官方示例 真机报错 window is not defined 求高人分享使用protobuff框架的游戏demo(TS版本或AS版本的) 如何通过命令行工具构建和发布...
来源: Laya_社区 发布时间: 20201223
...代码 //注意:IEditorEnv.regClass是必须的 @IEditorEnv.regClass() export class TestSceneScript { //注意:this是当前的IEditorEnv.IGameScene对象,如果不需要,也可以省略这个声明 static test(this: IEditorEnv.IGameScene, msg: string) { console.log(msg); //hello return "ok"...
来源: Laya3.0_文档 发布时间: 20251010
...2.0的版本开始,我用ts编写的相关内容,都要使用import和export吗? 关于Laya实现Matter.js官方案例凹多边形的问题 laya2的Scene默认是文件模式,不会生成场景类了,此时该如何获得场景内的元素 Laya2.6.0beta 物理引擎 刚体碰撞点位置...
来源: Laya_社区 发布时间: 20170822
...b.ts代码如下所示: ```javascript /** * 分包 */ module subpackage{ export class b{ private GameMain:any; private ui:any; constructor(){ //监听按钮btnA的点击事件,触发后处理 this.GameMain.newUI.btnA.on(Laya.Event.CLICK, this, this.showB); } //显示B页 private showB():void { t...
来源: Laya2.0_文档 发布时间: 20210715
...载代码示例如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已...
来源: Laya3.0_文档 发布时间: 20251010
...载代码示例如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一...
来源: Laya3.0_文档 发布时间: 20251010
... 3.2.2 创建地图示例 const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { private tMap:Laya.TiledMap; onEnable() { //创建地图对象 this.tMap = new Laya.TiledMap(); //创建Rectangle实例,视口区域 var viewRect:Laya.Rectangle = new Laya.Rectangle(0,...
来源: Laya3.0_文档 发布时间: 20251010