大约有 19 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0051 秒)
...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_文档 发布时间: 20241014
...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_文档 发布时间: 20241014
...的方式进行管理对象池: 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
... { 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_文档 发布时间: 20241014
...property({ type: Laya.Button }) public uiBtn: Laya.Button; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.uiBtn.on(Laya.Event.CLICK, this, () => { //点击后,打开Msg场景 Laya.Sce...
来源: Laya3.0_文档 发布时间: 20241014
...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_文档 发布时间: 20241014
... 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_文档 发布时间: 20241014
... { 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_文档 发布时间: 20241014
...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_文档 发布时间: 20241014
...: 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_文档 发布时间: 20241014