上一页 1 2 3 4 5 6 ··· 38 下一页
摘要: nums: number[] let nums_set:Set<number> = new Set(); for(const num of nums){ nums_set.add(num); } for...of 循环是 ES6 (ECMAScript 2015) 引入的一种新的 for 循环语法, 阅读全文
posted @ 2024-09-27 14:58 流星曳尾 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1、在物体的固定方向和距离放一个node1 2、 node.setPosition(this.node1.getWorldPosition()); node.setRotation(this.node1.getWorldRotation()); node.setScale(this.node1.ge 阅读全文
posted @ 2024-09-26 11:26 流星曳尾 阅读(2) 评论(0) 推荐(0) 编辑
摘要: let v = 100; let v3 = new Vec3(this.cylinder.forward.x * v, this.cylinder.forward.y * v, this.cylinder.forward.z * v); this.cylinder.getComponent(Rigi 阅读全文
posted @ 2024-09-19 14:29 流星曳尾 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 放到BoxCollider里了。setPosition到外面就好了 阅读全文
posted @ 2024-09-11 17:51 流星曳尾 阅读(1) 评论(0) 推荐(0) 编辑
摘要: start() { input.on(Input.EventType.MOUSE_DOWN, this.onMouseDown, this); } onMouseDown(event: EventMouse) { switch (event.getButton()) { case EventMous 阅读全文
posted @ 2024-09-11 14:34 流星曳尾 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 物体加刚体和碰撞组件 地面加静态刚体和碰撞组件(不静态就会被砸着往下走) 不加碰撞组件就会穿过去 阅读全文
posted @ 2024-09-10 19:25 流星曳尾 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 放进去的图类型是Texture。要改成sprite-frame才能作为sprite的Sprite Frame 阅读全文
posted @ 2024-08-26 17:35 流星曳尾 阅读(13) 评论(0) 推荐(0) 编辑
摘要: Camera 设置为 Player 的子节点。 这样 Camera 就会跟随 Player 的移动而移动了。 阅读全文
posted @ 2024-08-22 11:29 流星曳尾 阅读(47) 评论(0) 推荐(0) 编辑
摘要: Node Api 升级 APIv2.0.3v2.1 - 2.xv3.x rotation KEEP Number DEPRECATE,USE angle GET cc.Quat 阅读全文
posted @ 2024-07-08 14:10 流星曳尾 阅读(4) 评论(0) 推荐(0) 编辑
摘要: let sprite = node.getComponent(cc.Sprite); let material = cc.Material.getBuiltinMaterial('材质名'); sprite.setMaterial(0, material); 阅读全文
posted @ 2024-06-07 17:06 流星曳尾 阅读(4) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 38 下一页