大约有 13 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0055 秒)
...如下: const { regClass, property } = Laya; @regClass() class Animal { private _weight: number = 0; @property( { type : Number } ) get weight() : number { return this._weight; } //如果没有 Setter,则 weight 为只读属性 set weight(value: number) { this._weight = value; } } 2.3 是否序...
来源: Laya3.0_文档 发布时间: 20251010
...rty } = Laya; @regClass() export class UI_RadioGroup extends Laya.Script { private SPACING: number = 150; private X_OFFSET: number = 200; private Y_OFFSET: number = 80; private skins: any[]; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此...
来源: Laya3.0_文档 发布时间: 20251016
...roperty } = Laya; @regClass() export class NewScript extends Laya.Script { private ui : RuntimeScript; onStart() { // 获得场景的Runtime对象 this.ui = this.owner.scene as RuntimeScript; // Button添加鼠标事件,让Image不显示 this.ui.Button.on( Laya.Event.MOUSE_DOWN, null, ()=>{ thi...
来源: Laya3.0_文档 发布时间: 20251010
...property } = Laya; @regClass() export class UI_Input extends Laya.Script { private SPACING: number = 100; private Y_OFFSET: number = 50; private skins: any[]; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwa...
来源: Laya3.0_文档 发布时间: 20251010
...鼠标点击的位置 @property({ type: Laya.Sprite }) public hit: Sprite; private _temp: Sprite; private _allAgent: Nav2DAgent[] = []; private findCompents(lists: any[], sprite: Sprite, componentType: typeof Component) { let comp = sprite.getComponent(componentType); if (comp != null) { lists.push(...
来源: Laya3.0_文档 发布时间: 20251010
... @IEditor.panel("Test") export class MyPanel extends IEditor.EditorPanel { private _data : any; declare _panel : IEditor.InspectorPanel; async create() { this._panel = IEditor.GUIUtils.createInspectorPanel(); Editor.typeRegistry.addTypes([ { name : "MyPanelType", //请注意,名字是全局唯一...
来源: Laya3.0_文档 发布时间: 20251010
...ass } = Laya; @regClass() export class WebSocketDemo extends Laya.Script { private socket: Laya.Socket; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { this.socket = new Laya.Socket(); // 注册事件监听 this.socket.on(Laya.Event.OPEN, this, this.onSocketOpen); t...
来源: Laya3.0_文档 发布时间: 20251010
....Script { //declare owner : Laya.Sprite3D; @property( { type: Laya.Box } ) private box: Laya.Box; constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Lab...
来源: Laya3.0_文档 发布时间: 20241014
....Script { //declare owner : Laya.Sprite3D; @property( { type: Laya.Box } ) private box: Laya.Box; constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Lab...
来源: Laya3.0_文档 发布时间: 20251105
...der.load("../atlas/comp.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //实例UI界面 var testView:ui.test.TestPageUI = new ui.test.TestPageUI(); Laya.stage.addChild(testView); } } new LayaUISample; WorkerLoader.workerPath = "libs/worker.js"; 设置worker.js的路径...
来源: Laya3.0_文档 发布时间: 20251010