大约有 185 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0042 秒)
... const { regClass, property } = Laya; @regClass() export class SpotLight extends Laya.Script { @property({ type: Laya.Sprite }) private spotLight: Laya.Sprite; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { this.setSpotLight(); } // 创建聚光灯 setSpotLight(): ...
来源: Laya3.0_文档 发布时间: 20251010
...法获知,我点的是哪个,代码 如下 export default class btn1 extends Laya.Script { constructor(){super();} onEnable(){} onClick(){ alert("id="+this.id); //这里有一个id,但是系统自动生成的,无法获知这个id代表哪个按钮被点(因为我有4个按钮都绑了这...
来源: Laya_社区 发布时间: 20181029
...方式实现,比如子弹脚本。 */ export default class GameUI extends ui.test.TestSceneUI { private newScene:Laya.Scene3D; private boxA: Laya.MeshSprite3D; constructor() { super(); Laya3D.init(0, 0); Laya.stage.scaleMode = Laya.Stage.SCALE_FUL...
来源: Laya_社区 发布时间: 20210103
...脚本作为组件添加到精灵上。) ```typescript class colliderCheck extends Script3D{ /** * 开始触发时执行 * 此方法为虚方法,使用时重写覆盖即可 */ onTriggerEnter(other) { console.log("triggerEnter"); } /** * 持续触发时执行 * 此方法为虚方法,使用时重...
来源: Laya2.0_文档 发布时间: 20210715
...s脚本,添加如下代码,设置初始化Steam的接口, interface IExtendLib { // 初始化Steam initializeSteam(): number; // 返回1表示成功,0表示失败 } export const extendLib: IExtendLib = Laya.importNative("steam_demo.dll"); 然后在Scene2D上新建一个组件脚本,当点...
来源: Laya3.0_文档 发布时间: 20251010
...2.2以下的引擎版本。 vincent • 2019-08-28 18:27 class TestSceneUI extends Scene { constructor() { super(); } createChildren() { super.createChildren(); this.loadScene("test/TestScene"); } } UC指这行报错,这个都是编译后的代码 addScore(value = 1) { this._score += val...
来源: Laya_社区 发布时间: 20190828
... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Tree }) public tree: Laya.Tree; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { //初始化树状列表的数...
来源: Laya3.0_文档 发布时间: 20251010
... import BaseTexture = Laya.BaseTexture; export default class Test1Material extends BaseMaterial { public readonly MAIN_TEX:number = Shader3D.propertyNameToID("u_MainTex"); public readonly NOISE_TEX:number = Shader3D.propertyNameToID("u_NoiseTex"); public readonly Time:number = Shader3D.propertyNameT...
来源: Laya_社区 发布时间: 20190923
... inspector 不知道如何配置使用。 export class SplitAtlasDialog extends IEditor.Dialog { async create() { let panel = IEditor.GUIUtils.createInspectorPanel(); let data = Editor.getSettings("SplitAtlasSetting").data; panel.allowUndo = true; panel.inspect(data, "SplitAtlasSetting"); this.co...
来源: Laya_社区 发布时间: 20250731
... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.RadioGroup }) public radiogroup: Laya.RadioGroup; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.radiogr...
来源: Laya3.0_文档 发布时间: 20251016