大约有 175 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0058 秒)
...精灵添加组件(脚本) monkey.addComponent(MonkeyScript); scene.addChild(monkey); //设置相机的观察目标为小猴子 camera.transform.lookAt(monkey.transform.position, new Laya.Vector3(0, 1, 0)); this.text...
来源: Laya_社区 发布时间: 20190605
...码如下: ... import Vector3 = Laya.Vector3; ... export class AnimationScript extends Laya.AnimatorStateScript { ... private model: Laya.Sprite3D; /**@internal */ setPlayScriptInfo(animator: Laya.Animator | Laya.Animator2D, layerindex: number, playstate: Laya.AnimatorState | Laya.AnimatorState2D)...
来源: Laya3.0_文档 发布时间: 20251010
...上一杯红茶,写下了laya的故事。 工具及涉及:layaide+typescript+pomelo+tiledmap+其他工具 项目类型:mmorpg 人员:zom(客户端) + arrow(服务端) 进度:单机体验状态,实现 摇杆,切图,释放技能(由于人员和精力有限还需要处理公...
来源: Laya_社区 发布时间: 20161109
...,开发者可将脚本添加到2D场景中查看效果 */ export class Script extends Laya.Script { declare owner : Laya.Scene; area2D: Laya.Area2D; camera2D: Laya.Camera2D; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this...
来源: Laya3.0_文档 发布时间: 20251010
...如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { declare owner: Laya.Image; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { //需要先加载图集再使用,注意,图集要放到resources目录下或者在...
来源: Laya3.0_文档 发布时间: 20251128
... { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onAwake(): void { let img = new Laya.Image; Laya.stage.addChild(img); img.pos(500,100); img.skin = "resources/layabox.png"; //纹理压缩的图片的路径 } onStart() { Laya.Stat.show(0, 0); //性能面板 } } 发...
来源: Laya3.0_文档 发布时间: 20251010
...ss, property } = Laya; @regClass() export class LightOccluder extends Laya.Script { private spotLight: Laya.Sprite = new Laya.Sprite(); private background: Laya.Sprite = new Laya.Sprite(); private lightOccluder: Laya.Sprite = new Laya.Sprite(); private backgroundTexture: string = "resources/bg2.png"...
来源: Laya3.0_文档 发布时间: 20251010
...精灵添加组件(脚本) monkey.addComponent(MonkeyScript); scene.addChild(monkey); //设置相机的观察目标为小猴子 camera.transform.lookAt(monkey.transform.position, new Laya.Vector3(0, 1, 0)); ...
来源: Laya_社区 发布时间: 20190531
...动进入触发器的生命周期。 2.4.4 使用生命周期方法 创建Script3D脚本 生命周期的方法,只能在脚本类里使用,所以,我们需要创建一个脚本,3D游戏必须要继承3D的脚本Script3D。空脚本的示例代码如下: /** * TypeScript语言的3D脚本示...
来源: Laya3.0_文档 发布时间: 20251010
...代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Sprite }) public sprite1: Laya.Sprite; @property({ type: Laya.Sprite }) public sprite2: Laya.Sprite; constructor() { super(); } /** * 组件...
来源: Laya3.0_文档 发布时间: 20251010