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

大约有 73 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0038 秒)

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

...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_示例 发布时间: 20240930

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

...有能够清除这个节点的纹理                 (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

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

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

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

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

...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

15. onCollisionEnter检测不到碰撞 [ 86%]

...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

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

...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

17. 2.0版本可用的CameraMoveScript.ts [ 85%]

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

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

18. 请问Laya如何使用第三方物理库 [ 83%]

...ld, OnDisable则移除, onUpdate里面根据CANNONBody的信息更新(this.owner as Laya.MeshSprite).transfrom.(最好用插值,平滑点,四元数代码就拷贝Laya源码改改.) isKinematic 则根据(this.owner as Laya.MeshSprite).transfrom的位置信息更新CANNONBody 2020-02-26 0 2 分享 微...

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

19. Camera.viewportToRay中origin与direction相等问题 [ 83%]

...ce.mainCamera.viewportPointToRay(this._rayPt, this._ray); let scene = this.owner.scene as Laya.Scene3D; scene.physicsSimulation.rayCast(this._ray, this._raycastHit); console.log(this._raycastHit.succeeded); if(this._raycastHit.succeeded) console.log(this._raycastHit.collider.owner.name); } GameManag...

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

20. 如何直播放对象自身的时间轴动画? [ 83%]

...prefab是带时间轴动画的,绑定了脚本,实例化出来后 this.owner如何播放动画啊?   var prefabInstantce=this.owner as Laya.Animation;   prefabInstantce.play("aniRota")   我就是想直接播放自身的动画而已 2019-06-16 添加评论 免费帖 --> 分享 微博 QZONE ...

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