大约有 148 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0043 秒)
...。下面给出一个示例代码,实现脚本控制FontClip: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property( { type : Laya.FontClip } ) public fontclp: Laya.FontClip; constructor() { super(); } // 组件被激活后执行,此时所有...
来源: Laya3.0_文档 发布时间: 20251010
...后台脚本执行结束后,后台进程会自动退出。 @IEditorEnv.regClass() class MyScript { static async buildWeb() { return IEditorEnv.BuildTask.start("web").waitForCompletion(); } } (图2-1) 下面给出各平台的发布脚本, @IEditorEnv.regClass() class MyScript { // 构建web s...
来源: Laya3.0_文档 发布时间: 20251010
...中。下面给出一个示例代码,实现脚本控制Label: const { regClass, property } = Laya; @regClass() export class LabelControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激...
来源: Laya3.0_文档 发布时间: 20251010
...添加如下代码,实现鼠标点击后,获取地理位置。 const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { constructor() { super(); } onMouseClick(evt: Laya.Event): void { // 尝试获取当前位置 Laya.Geolocation.getCurrentPosition( Laya.Hand...
来源: Laya3.0_文档 发布时间: 20251010
...ript中使用本地能力 下面是一个推荐做法: //Script.ts @Laya.regClass() class Script extends Laya.Script { wantToUseNode() { EditorEnv.scene.runScript("TestSceneScript.visitNode"); } } //TestSceneScript.ts import fs from "fs"; //注意是IEditorEnv.regClass,不是Laya.regClass!! @IEd...
来源: Laya3.0_文档 发布时间: 20251010
...”中用代码对Animation进行控制了,示例代码如下: const { regClass, property } = Laya; @regClass() export class Animation extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Animation }) //在IDE面板中显示属性 ani: Laya.Animation; constructor() { sup...
来源: Laya3.0_文档 发布时间: 20251010
...s具体是做什么用的? 看到生成的空工程里有Laya.ClassUtils.regClass,一直没有搞明白这个类具体是做什么用的,如何使用。生成的示例工程有有bullet的注册,但是没有看到具体是在什么地方使用的。也没看看到相关的文档,所以这...
来源: Laya_社区 发布时间: 20190101
...ayaAir3]V3.2 | 调试结果不一致,导致无法判断结果? const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { testData = new Laya.Vector3(1, 1, 1); @property(Laya.Camera) camera: Laya.Camera; onStart() { //@ts-ignore window.ca...
来源: Laya_社区 发布时间: 20241029
...。下面给出一个示例代码,实现脚本控制TextInput: const { regClass, property } = Laya; @regClass() export class TextInputControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextInput } ) public txtin: Laya.TextInput; constructor() { super(); } /**...
来源: Laya3.0_文档 发布时间: 20251010
...要添加如下的示例代码,实现脚本控制RadioGroup: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.RadioGroup }) public radiogroup: Laya.RadioGroup; //组件被激活后执行,此时所有节点和组件均已创建...
来源: Laya3.0_文档 发布时间: 20251016