大约有 7 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0045 秒)
...另一个方便显示输出的`Text`文本。 脚本类: ```typescript //重写脚本中的onUpdate方法 override public function onUpdate():void { var touchCount:int = _scene.input.touchCount(); if (1 === touchCount){ //判断是否为两指触控,撤去一根手指后引发的touchCount===1 i...
来源: Laya2.0_文档 发布时间: 20210715
...另一个方便显示输出的`Text`文本。 脚本类: ```typescript //重写脚本中的onUpdate方法 onUpdate() { var touchCount = this._scene.input.touchCount(); if (1 === touchCount){ //判断是否为两指触控,撤去一根手指后引发的touchCount===1 if (this.isTwoTouch){ return; ...
来源: Laya2.0_文档 发布时间: 20210715
...另一个方便显示输出的`Text`文本。 脚本类: ```typescript //重写脚本中的onUpdate方法 onUpdate() { var touchCount = this._scene.input.touchCount(); if (1 === touchCount){ //判断是否为两指触控,撤去一根手指后引发的touchCount===1 if (this.isTwoTouch){ return; ...
来源: Laya2.0_文档 发布时间: 20210715
...s Script3D{ /** * 开始触发时执行 * 此方法为虚方法,使用时重写覆盖即可 */ onTriggerEnter(other) { console.log("triggerEnter"); } /** * 持续触发时执行 * 此方法为虚方法,使用时重写覆盖即可 */ onTriggerStay(other) { console.log("triggerStay"); } /** * 结...
来源: Laya2.0_文档 发布时间: 20210715
...s Script3D{ /** * 开始触发时执行 * 此方法为虚方法,使用时重写覆盖即可 */ onTriggerEnter(other: PhysicsComponent): void { console.log("triggerEnter"); } /** * 持续触发时执行 * 此方法为虚方法,使用时重写覆盖即可 */ onTriggerStay(other: PhysicsComponent):...
来源: Laya2.0_文档 发布时间: 20210714
...mo box.addComponent(TSDemo); } /* ……省略若干代码 */ } ``` ###### 重写物理生命周期方法 之前介绍过,物理事件的生命周期方法分别为三个碰撞事件方法和三个触发事件方法。我们在使用的时候,重写这些虚方法即可,当物理行为触发...
来源: Laya2.0_文档 发布时间: 20210715
...后,开发者可以为这些节点挂接Script脚本。在脚本中直接重写以上虚方法的代码逻辑。当运行触发了这些物理碰撞条件,就可以自动执行相应的代码逻辑。 ## 本文赞赏 如果您觉得本文对您有帮助,欢迎扫码赞赏作者,您的激励...
来源: Laya2.0_文档 发布时间: 20210714