摘要:
nums: number[] let nums_set:Set<number> = new Set(); for(const num of nums){ nums_set.add(num); } for...of 循环是 ES6 (ECMAScript 2015) 引入的一种新的 for 循环语法, 阅读全文
摘要:
1、在物体的固定方向和距离放一个node1 2、 node.setPosition(this.node1.getWorldPosition()); node.setRotation(this.node1.getWorldRotation()); node.setScale(this.node1.ge 阅读全文
摘要:
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 阅读全文
摘要:
放到BoxCollider里了。setPosition到外面就好了 阅读全文
摘要:
start() { input.on(Input.EventType.MOUSE_DOWN, this.onMouseDown, this); } onMouseDown(event: EventMouse) { switch (event.getButton()) { case EventMous 阅读全文
摘要:
物体加刚体和碰撞组件 地面加静态刚体和碰撞组件(不静态就会被砸着往下走) 不加碰撞组件就会穿过去 阅读全文
摘要:
放进去的图类型是Texture。要改成sprite-frame才能作为sprite的Sprite Frame 阅读全文
摘要:
Camera 设置为 Player 的子节点。 这样 Camera 就会跟随 Player 的移动而移动了。 阅读全文
摘要:
Node Api 升级 APIv2.0.3v2.1 - 2.xv3.x rotation KEEP Number DEPRECATE,USE angle GET cc.Quat 阅读全文