大约有 4 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0023 秒)
...{ this._level = Math.round(Math.random() * 5) + 1; this._text = this.owner.getChildByName("levelTxt") as Laya.Text; this._text.text = this._level + ""; } //每帧更新时执行 onUpdate(): void { //让持续盒子旋转 (this.owner as Laya.Sprite).rotation++; } //开始碰撞时执行 onTriggerEnte...
来源: Laya3.0_文档 发布时间: 20251010
...取场景中要添加视频纹理的3D节点 this.videoPlane = this.scene.getChildByName("Plane") as Laya.Sprite3D; //使用指定路径的视频文件 this.createVideo("resources/mov_bbb.mp4"); } //创建视频纹理并将其应用到Sprite3D上 private createVideo(url: string): void { //设置纹...
来源: Laya3.0_文档 发布时间: 20251010
...某个名字的子节点,通常会调用如下方法来获取子节点 getChildByName("xxx") /** * 根据子节点的名字,获取子节点对象。 * @param name 子节点的名字。 * @return 节点对象。 */ getChildByName(name: string): Node { for (let child of this._children) { if (child...
来源: Laya3.0_文档 发布时间: 20251010
...tateInfo.playState = playstate; this._label = animator.owner.scene.scene2D.getChildByName("Label"); } constructor() { super(); } /** * 动画状态开始时执行。 */ onStateEnter(): void { console.log("动画开始播放了"); this._label.text = "开始跑动画"; } /** * 动画状态运行中 * ...
来源: Laya3.0_文档 发布时间: 20251010