• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 148 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0034 秒)

81. [LayaAirIDE3]咋么实现鼠标点击角色移动 [ 66%]

...图确实难以判断 ZmySir • 2025-12-22 15:40 @LayaAir小牛:const { regClass, property } = Laya; @regClass() export default class iceMonster extends Laya.Script { declare owner: Laya.Sprite; /** 用于兜底的 Animator2D(可选) */ private _animator: Laya.Animator2D; /** 承载 .mc 的动...

来源: Laya_社区 发布时间: 20251211

82. ProtocolBuffer通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 66%]

...当前文件 import * as protobuf from "./libs/protobuf/protobuf"; const { regClass } = Laya; @regClass() export class ProtobufDemo extends Laya.Script { onEnable() { console.log("Game start"); } } 2.2 Protobuf示例脚本 引入了protobuf模块就可以直接在项目中使用了,这里我们写...

来源: Laya3.0_文档 发布时间: 20251010

83. 分享:关于自定义场景继承的实现 [ 65%]

...ene"; import BaseScene=base.BaseScene; var REG: Function = Laya.ClassUtils.regClass; export module ui { export class CustomSceneUI extends BaseScene { public txt_hello:Laya.Label; constructor(){ super()} createChildren():void { super.createChildren(); this.loadScene("CustomScene"); } } REG("ui.Custo...

来源: Laya_社区 发布时间: 20200827

84. 2D自由形态光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 65%]

...备了一个脚本示例供大家参照。 示例代码如下: const { regClass } = Laya; @regClass() export class LightEffectDemo extends Laya.Script { declare owner: Laya.Sprite; private lightComp: Laya.FreeformLight2D; private rotateSpeed: number = 2; // 增加旋转速度 private scaleTime: nu...

来源: Laya3.0_文档 发布时间: 20251010

85. 2D精灵光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 65%]

...点后,加入下述代码,实现一个2D精灵光的效果: const { regClass, property } = Laya; @regClass() export class SpriteLight extends Laya.Script { @property({type: Laya.Sprite}) private spriteLight: Laya.Sprite; @property({type: Laya.Sprite}) private directLight: Laya.Sprite; @propert...

来源: Laya3.0_文档 发布时间: 20251010

86. 基础使用与构成 · LayaAir3.3 · 引擎文档 · LAYABOX [ 63%]

...代码如下: import { ItemBoxBase } from "./ItemBox.generated"; const { regClass, property } = Laya; @regClass() export class Script extends ItemBoxBase { constructor() { super(); } get dataSource(): any { return super.dataSource; } set dataSource(value: any) { super.dataSource = value; if (!valu...

来源: Laya3.0_文档 发布时间: 20251010

87. 模型与动画的导入使用 · LayaAir3.3 · 引擎文档 · LAYABOX [ 63%]

...BoardManager = Laya.InputManager; import Keyboard = Laya.Keyboard; const { regClass, property } = Laya; @regClass() export class Main extends MainBase { private _animator: Laya.Animator; private _isRun: boolean; onAwake() { console.log("Game start"); //加载指定的模型预制体,并添加到Sc...

来源: Laya3.0_文档 发布时间: 20251010

88. ClassUtils [ 63%]

...容相关的链接 提交 1 个回复 wudi199553 赞同来自: ClassUtils.regClass("sp",Sprite); trace(ClassUtils.getClass("sp"));   2017-11-07 0 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 Moeb 问题状态 最新活动: 2017-11-07 10...

来源: Laya_社区 发布时间: 20171107

89. 导出代码会删除代码 [ 63%]

导出代码会删除代码 var REG: Function = Laya.ClassUtils.regClass;只有清理重新导出才会在 layaMaxUI.ts 生成 这句代码     当使用导出代码(不导出资源)会吧这句代码删除导致报错     是不是每次改动都需要清理导出才可以吗? 2020-0...

来源: Laya_社区 发布时间: 20200113

90. 反射实例中的属性 [ 62%]

...口 class GameMain { constructor() { Laya.init(600, 400); Laya.ClassUtils.regClass("sp", Reflect); Laya.ClassUtils.getInstance('sp').prototype.name } } new GameMain(); class Reflect { public name: string = "mmmmm"; constructor() { } public write(): void { console.log("qqqqqqqq"); } } 2018-10-29 添...

来源: Laya_社区 发布时间: 20181029