大约有 56 项符合查询结果, 库内数据总量为 30,784 项。 (搜索耗时: 0.0062 秒)
...如下: const { regClass, property } = Laya; @regClass() class Animal { private _weight: number = 0; @property( { type : Number } ) get weight() : number { return this._weight; } set weight(value: number) { this._weight = value; } } 2.3 是否序列化保存 通过装饰器定义为组件属性后...
来源: Laya3.0_文档 发布时间: 20241014
...如下: const { regClass, property } = Laya; @regClass() class Animal { private _weight: number = 0; @property( { type : Number } ) get weight() : number { return this._weight; } set weight(value: number) { this._weight = value; } } 3.2.3 是否序列化保存 通过装饰器定义为组件属性...
来源: Laya3.0_文档 发布时间: 20241014
...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_文档 发布时间: 20241014
...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_文档 发布时间: 20241014
...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_文档 发布时间: 20241014
...开时还原按钮。 this.on(Laya.Event.MOUSE_OUT,this, this.scaleBig); } private scaleBig():void { //变大还原的缓动效果 Laya.Tween.to(this, {scaleX:1,scaleY:1},this.scaleTime); } private scaleSmall():void { //缩小至0.8的缓动效果 Laya.Tween.to(this,{scaleX:0.8,scaleY:0.8},this.scal...
来源: Laya2.0_文档 发布时间: 20210715
... @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_文档 发布时间: 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_文档 发布时间: 20241014
...er.load("res/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的路...
来源: Laya2.0_文档 发布时间: 20210715
...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_文档 发布时间: 20241014