大约有 71 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0045 秒)
...的。 在编辑的时候两种onUpdate也是有差异的,extends Laya.Script的脚本中的onUpdate,鼠标移上去是有功能说明的:每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法 此方法为虚方法,使用时重写覆盖即可 2019-02-21...
来源: Laya_社区 发布时间: 20190221
... class GameConfig { static init() { //注册Script或者Runtime引用 let reg = Laya.ClassUtils.regClass; reg("script/GameMain.js",GameMain); } } GameConfig.width = 640; GameConfig.height = 1136; GameConfig.sca...
来源: Laya_社区 发布时间: 20201110
...gClass, property } = Laya; @regClass() export class SpineTest extends Laya.Script { //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { //加载预制体文件 Laya.loader.load("resources/spine3.8/boy/spineboy-pma_bake.lh").then((res) => { // 创建预制体 let spin...
来源: Laya3.0_文档 发布时间: 20251010
...工具。 const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property(Number) public projectId: number = 23; private perfMain: LayaPerf = new LayaPerf(); onEnable(): void { this.perfMain.init(this.projectId); } } projectId使用后端给项目分配的项...
来源: Laya3.0_文档 发布时间: 20251010
...7.1 射线提示rayCast未定义 export default class click3d extends Laya.Script3D{ constructor() { super(); //创建场景 this.scene = Laya.stage.addChild(new Laya.Scene3D()); //添加相机 this.camera = (this.scene.addChild(new Laya.Camera(0, 0.1, 100))); this.camera.transform.translate(new Lay...
来源: Laya_社区 发布时间: 20200801
...game_plugin_init(3); 真机调试报错:LayaPlayer不支持的标签</SCRIPT> 用了ByteArray的zlib.min.js后报错 问题状态 最新活动: 2020-02-03 12:08 浏览: 840 关注: 1 人
来源: Laya_社区 发布时间: 20200203
...t { regClass } = Laya; @regClass() export class WebSocketDemo extends Laya.Script { private socket: Laya.Socket; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { this.socket = new Laya.Socket(); // 注册事件监听 this.socket.on(Laya.Event.OPEN, this, this.onSocke...
来源: Laya3.0_文档 发布时间: 20251010
...去做相机跟踪 代码如下: export default class test extends Laya.Script { strWorldRoot:Laya.Sprite; constructor() { super(); } cameraPlayerOffset:Laya.Point=new Laya.Point(18,0); cameraOffset:Laya.Point=new Laya.Point(180,570); onEnable(): void { ...
来源: Laya_社区 发布时间: 20231123
...再把CANNON.Body包装成组件 export class CannonRigidbody extends Laya.Script3D { static map: { [key: number]: Laya.Sprite3D } = {}; body: CANNON.Body; t: Laya.Transform3D; public onCollisionCB: (s: Laya.Sprite3D) => void; public ignoreRotate: boolean = false; ...OnAwake里面创建CANNON.Bod...
来源: Laya_社区 发布时间: 20200217
... { regClass, property } = Laya; @regClass() export class Demo extends Laya.Script { spine3D: Laya.Spine3DRenderer; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { // 加载Spine动画数据资源(json文件),注意一定...
来源: Laya3.0_文档 发布时间: 20260203