大约有 7 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0036 秒)
...是即使节点未激活onAdded也会调用 onAdded(): void { console.log("Game onAdded"); } //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { console.log("Game onAwake"); } //组件被启用后执行,比如节点被添加到舞...
来源: Laya3.0_文档 发布时间: 20251010
...animator: Laya.Animator; private _isRun: boolean; onAwake() { console.log("Game start"); //加载指定的模型预制体,并添加到Scene3D场景内 Laya.loader.load("girl/girl.lh").then(res => { let girl : Laya.Sprite3D = res.create(); this.scene3D.addChild(girl); //获得Animator this._anim...
来源: Laya3.0_文档 发布时间: 20251010
...e(this.loadingScene); Laya.timer.once(3000,this,()=>{ //3秒后跳转到Game场景 Laya.Scene.open("Game.ls"); }) } } 在打开的场景Scene.ls下,挂上脚本,并拖入Loading.lh作为场景。 (图2-5) 这样就可以使用Loading场景作为加载场景了。 2.5 销毁和垃圾回收...
来源: Laya3.0_文档 发布时间: 20251010
...wScript extends Main { private ui: RuntimeScript; onStart() { console.log("Game start"); this.ui = this.owner.scene as RuntimeScript; super.baseUI(this.ui); } } import { Main } from "./Main"; import { ButtonRuntime } from "./ButtonRuntime"; const { regClass, property } = Laya; @regClass() export cla...
来源: Laya3.0_文档 发布时间: 20251010
...特效的路径 private filePath = "FireEffect"; onStart() { console.log("Game start"); //加载粒子特效资源 Laya.loader.load(this.filePath, Handler.create(this, () => { })); } //每次鼠标点下屏幕后,会创建一个特效 mouseDown(e: Event): void { var particle = Particle3D.Create...
来源: Laya3.0_文档 发布时间: 20251010
...特效的路径 private filePath = "FireEffect"; onStart() { console.log("Game start"); //加载粒子特效资源 Laya.loader.load(this.filePath, Handler.create(this, () => { })); } //每次鼠标点下屏幕后,会创建一个特效 mouseDown(e: Event): void { var particle = Particle3D.Create...
来源: Laya3.0_文档 发布时间: 20250104
...) sp3: Laya.Sprite3D; constructor() { super(); } onEnable() { console.log("Game onStart", this.sp3.name); } } 除非有特别的需求,我们并不建议这样做,一方面是因为静态物体更有利于IDE内进行编辑。另一方面是因为场景编辑器为了性能优化,帧率刷新...
来源: Laya3.0_文档 发布时间: 20251010