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

大约有 19 项符合查询结果, 库内数据总量为 30,723 项。 (搜索耗时: 0.0042 秒)

1. 3D变换 · LayaAir3.0文档 · LAYABOX [ 100%]

...ivate translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { // 平移cube this.cube.transform.translate(this.translate, false); } } 效果如图1-1...

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

2. 列表组件 · LayaAir3.0文档 · LAYABOX [ 83%]

...ya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { // 给List对象赋值 var data: Array<any> = []; for (var m: number = 0; m < 20; m++) { data.push({ m_label: "No." + m })...

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

3. 对象池 · LayaAir3.0文档 · LAYABOX [ 78%]

...的方式进行管理对象池: export class EffectA { constructor() { super(); } static create(): EffectA { Pool.getItemByClass(EffectA); } recover(): void { Pool.recoverByClass(this); } } export class EffectB { constructor() { super(); } static create(): EffectB { Pool.getItemByClass(EffectB); }...

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

4. 字体切片组件 · LayaAir3.0文档 · LAYABOX [ 68%]

... { type : Laya.FontClip } ) public fontclp: Laya.FontClip; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.fontclp.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.fo...

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

5. 场景管理 · LayaAir3.0文档 · LAYABOX [ 66%]

...property({ type: Laya.Button }) public uiBtn: Laya.Button; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.uiBtn.on(Laya.Event.CLICK, this, () => { //点击后,打开Msg场景 Laya.Sce...

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

6. 像素线 · LayaAir3.0文档 · LAYABOX [ 63%]

...name 名字。 */ constructor(maxCount: number = 2, name: string = null) { super(name); this._render = this.addComponent(PixelLineRenderer); this._geometryFilter = (this._render as PixelLineRenderer)._pixelLineFilter; (this._render as PixelLineRenderer).maxLineCount = maxCount; let material = this._...

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

7. 插件开发说明 · LayaAir3.0文档 · LAYABOX [ 63%]

... class DemoPreviewPlugin extends IEditorEnv.AssetPreview { constructor() { super(); this.sprite.graphics.drawCircle(100, 100, 50, "#ffff00"); this.sprite.size(100, 100); } async setAsset(asset: IEditorEnv.IAssetInfo): Promise<any> { this.renderTarget = this.sprite; } } 显示效果如下: ...

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

8. UI运行时 · LayaAir3.0文档 · LAYABOX [ 58%]

... { console.log("Game start"); this.ui = this.owner.scene as RuntimeScript; super.baseUI(this.ui); } } import { Main } from "./Main"; import { ButtonRuntime } from "./ButtonRuntime"; const { regClass, property } = Laya; @regClass() export class ButtonScript extends Main { private ui: ButtonRuntime; o...

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

9. 使用3D精灵 · LayaAir3.0文档 · LAYABOX [ 55%]

...ne: Laya.Scene3D = new Laya.Scene3D; speed: number = 0.01; constructor() { super(); } /** * @private */ protected _updateRotation(): void { if (Math.abs(this.yawPitchRoll.y) < 1.50) { Laya.Quaternion.createFromYawPitchRoll(this.yawPitchRoll.x, this.yawPitchRoll.y, this.yawPitchRoll.z, this.tempRo...

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

10. 网络通信 · LayaAir3.0文档 · LAYABOX [ 53%]

...: class HttpRequestExtension extends Laya.HttpRequest { constructor() { super(); } public send(url:string,data:any=null,method:string="get", responseType:string="text", headers:any=null):void{ super.send(url,data,method,responseType,headers); this._http.upload.onprogress= function(e:any):void { //...

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