• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 82 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0033 秒)

11. 2.6物理问题 [ 84%]

...地面都设置了弹力   TestScript2  onAwake   this.scene3D = this.owner as Scene3D; this.basketballCourt = this.scene3D.getChildByName("BasketballCourt") as Sprite3D; var collision:PhysicsCollider = this.basketballCourt.getChildByName("BasketballCourt1").getComponent(PhysicsCollider); collis...

来源: Laya_社区 发布时间: 20200515

12. 碰撞检测 outHitInfo.distance 一直等于 -1 ?(TS代码) [ 82%]

...RaycastHit(); } /*覆写3D组件方法,指3D对象加载组件时执行 *owner:此组件所属的3D对象 */ public _load(owner:Laya.Sprite3D):void{ //获取控制器UI this.rocker = Example_roleControl.rocker; this.attack = Example_roleControl.attack; } /*覆写加载组件的3D对象实例化...

来源: Laya_社区 发布时间: 20171113

13. 2D物理-碰撞事件与传感器 [ 82%]

...this.touching[i]) { continue; } let bodyA: RigidBody = this.sensorCollider.owner.getComponent(RigidBody); let bodyB: RigidBody = body.owner.getComponent(RigidBody); let bodyOriA = bodyA.getBody(); let bodyOriB = bodyB.getBody(); let position = bodyOriB.GetPosition(); // let center = bodyOriA.GetPosi...

来源: Laya2.0_示例 发布时间: 20251130

14. 写的更换纹理的代码不生效,大佬帮忙看一下。(工程附件已经上传) [ 82%]

...有能够清除这个节点的纹理                 (this.owner as Laya.Sprite).graphics.clear();                 var t: Laya.Texture = Laya.loader.getRes("puzzlePic/pi-" +this.levelNum +"-"+this.owner.name.slice(4,1)+ "-2.png");               ...

来源: Laya_社区 发布时间: 20201012

15. 裁切图片后,该用什么方式去重绘出裁切后的图片 [ 81%]

...边形位置点数据): draw() {         const pp = this.owner.getComponent(Laya.PolygonCollider).points;         let points = this.pointS_to_pointA(pp)         let owner: Laya.Sprite = this.owner as Laya.Sprite         const ctx = owner.graphics; ...

来源: Laya_社区 发布时间: 20200428

16. 2.0TS3D物体碰撞,如何获取双方包围盒 [ 79%]

...r: Laya.PhysicsComponent): void { console.log("box2_onTriggerStay " + this.owner.name + " "+ other.owner.name); let b1:Laya.BoundBox = this.box.meshRenderer.boundingBox; let box2:Laya.MeshSprite3D = other.owner as Laya.MeshSprite3D; let b2:Laya.BoundBox = box2.meshRenderer.boundingBox; }获取boundi...

来源: Laya_社区 发布时间: 20181116

17. 鼠标脚本(ActionScript-3D基础(AS3)-LayaAir3D之鼠标交互) [ 78%]

...---Script3D中的鼠标事件。如果想要使用鼠标脚本,在脚本owner上还是需要有物理碰撞器。 **Tips**:鼠标脚本依赖射线检测,只不过不用开放者自己手动创建射线了。 **鼠标脚本内容:** > Method `onMouseClick():void` 鼠标点击时执行 `onMou...

来源: Laya2.0_文档 发布时间: 20210715

18. onCollisionEnter检测不到碰撞 [ 77%]

...ollision:Laya.Collision):void { console.log("碰撞"); if (collision.other.owner === this.sphere){ ((this.owner as Laya.MeshSprite3D).meshRenderer.sharedMaterial as Laya.BlinnPhongMaterial).albedoColor = new Laya.Vector4(0.0, 0.0, 0.0, 1.0); } } 附件 : --> 2019-08-17 添加评论 免费帖 --> 分...

来源: Laya_社区 发布时间: 20190817

19. 3D 触发器如何获取碰撞位置 [ 77%]

...lisionEnter(obj: Laya.Collision) { let node: Laya.MeshSprite3D = obj.other.owner as Laya.MeshSprite3D; let owner: Laya.MeshSprite3D = this.owner as Laya.MeshSprite3D; let position = obj.contacts[0].positionOnA; // 碰撞位置 }     onTriggerEnter(obj) 、、如何获取碰撞位置? 2020-04-08 ...

来源: Laya_社区 发布时间: 20200408

20. 2.0版本可用的CameraMoveScript.ts [ 77%]

.../ onAwake(): void {         this.camera = (<Laya.Camera>this.owner);     }          /**          * @inheritDoc          */         /*override*/ onUpdate(): void {         var elapsedTime: number = Laya.timer.delta;         if (!isNaN...

来源: Laya_社区 发布时间: 20200707