大约有 10 项符合查询结果, 库内数据总量为 30,784 项。 (搜索耗时: 0.0066 秒)
...如下: 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
... @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
...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
...3; ... export class AnimationScript extends Laya.AnimatorStateScript { ... private model: Laya.Sprite3D; /**@internal */ setPlayScriptInfo(animator: Laya.Animator | Laya.Animator2D, layerindex: number, playstate: Laya.AnimatorState | Laya.AnimatorState2D) { ... this.model = animator.owner as Laya.Sp...
来源: Laya3.0_文档 发布时间: 20241014
...示: /* ……省略若干代码 */ /**增加圆锥形刚体碰撞器 */ private addCone(): void { //生成随机值半径和高 let raidius = Math.random() * 0.2 + 0.2; let height = Math.random() * 0.5 + 0.8; //创建圆锥形3D模型节点对象 let cone = new Laya.Sprite3D; let coneMesh = cone....
来源: Laya3.0_文档 发布时间: 20241014