大约有 140 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0427 秒)
...会执行一次 * 此方法为虚方法,使用时重写覆盖即可 */ onStart(): void { this.camera = this.owner as Laya.Camera; if (this.target) { this.target.transform.position.cloneTo(this.curpos); this.delatpos = new Laya.Vector3(); } } /** * 每帧更新时执行,尽量不要在这里写...
来源: Laya3.0_文档 发布时间: 20251010
...ody(rigidBody,rigidBody2); ``` - 3.设置约束的breakForce ```typescript onStart() { this.fixedConstraint = this.owner.getComponent(FixedConstraint); //设置打破约束的力的阈值 this.fixedConstraint.breakForce = 1000; } onUpdate() { if(this.fixedConstraint) { var mass = this.fixedConstrain...
来源: Laya2.0_文档 发布时间: 20210715
...ody(rigidBody,rigidBody2); ``` - 3.设置约束的breakForce ```typescript onStart() { this.fixedConstraint = this.owner.getComponent(FixedConstraint); //设置打破约束的力的阈值 this.fixedConstraint.breakForce = 1000; } onUpdate() { if(this.fixedConstraint) { var mass = this.fixedConstrain...
来源: Laya2.0_文档 发布时间: 20210715
...; ``` - 3.设置约束的breakForce ```typescript override public function onStart() { this.fixedConstraint = this.owner.getComponent(FixedConstraint); //设置打破约束的力的阈值 this.fixedConstraint.breakForce = 1000; } override public function onUpdate() { if(this.fixedConstraint) { var m...
来源: Laya2.0_文档 发布时间: 20210714
...ty( { type: Laya.Box } ) private box: Laya.Box; constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Label字体到box节点下 this.box.addChild( label )...
来源: Laya3.0_文档 发布时间: 20241014
...ty( { type: Laya.Box } ) private box: Laya.Box; constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Label字体到box节点下 this.box.addChild( label )...
来源: Laya3.0_文档 发布时间: 20251105
...脚本(即GameControl)未被激活的情况下,执行了onEnable和onStart里面的内容,onUpdate是正常没执行的。换成2.0测试版(即beta4)的库后是正常的。怀疑是2.0正式版的库存在问题,我之前也在社区提问问过这个问题,但没人解决,希望...
来源: Laya_社区 发布时间: 20181106
...ss, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { alert(testLib.nativeAdd(10, 11)); } } 因为LayaNative的扩展功能只支持Windows平台,所以只能通过Windows预览或发布为Windows项目才能得到正确的结果。运行效果如图3-2所示, ...
来源: Laya3.0_文档 发布时间: 20251010
...xport class Main extends Laya.Script { private aStarInstance: AStarFinder; onStart() { console.log("Game start"); // 0表示通路,1表示障碍 let myMatrix = [ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0], [1, 1,...
来源: Laya3.0_文档 发布时间: 20251010
... 组件被启用后执行,比如,节点被添加到舞台后执行 | | onStart | 在第1次执行update之前执行,只会执行一次, | | onUpdate | 每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法 | | onLateUpdate | 每帧更新之后执行,...
来源: Laya2.0_文档 发布时间: 20210715