是我搞错了哈,没看到改版了
3.4.0+版本编辑器在切换最大化与窗口化之间会出现各种bug,例如项目会显示未保存,以及如下面图片那样不见了资源管理器窗口和console窗口(窗口化时候才会显示,最大化时候不显示),同时场景编辑器无限长度:
大大看下这个,我应该怎么获取meshrender上材质的名字?
bug1:
tween(a节点)时候没办法改变a节点的位置,需要将position赋值给一个新的Vec3()才可以进行更新。这是有意为之吗?
像这样是可以更新的:
@property(Node)
moveTextNode: Node = null;
private moveTextNodeSrcPos: Vec3 = null;
start() {
this.moveTextNodeSrcPos = this.moveTextNode.position;
log("this.moveTextNodeSrcPos:",this.moveTextNodeSrcPos);
this.move();
}
move() {
console.log("move");
let textWidth = this.moveTextNode.getComponent(UITransform).width;
let textMaskWidth = this.moveTextNode.parent.getComponent(UITransform).width;
let moveWidth = textWidth + textMaskWidth + 50;
console.log("moveWidth:", moveWidth);
tween(this.moveTextNode)
.by(10, { position: new Vec3(-moveWidth, 0, 0) })
.call(()=>{
//恢复他的位置
this.moveTextNode.setPosition(new Vec3(-50, 0, 0));
log("onComplete:",this.moveTextNode.position);
})
.start();
}
但是如果改为如下是不可以更新正在移动的tween的a节点的Position:
start() {
this.moveTextNodeSrcPos = new Vec3(this.moveTextNode.position.x,this.moveTextNode.position.y,this.moveTextNode.position.z);
log("this.moveTextNodeSrcPos:",this.moveTextNodeSrcPos);
this.move();
}
move() {
console.log("move");
let textWidth = this.moveTextNode.getComponent(UITransform).width;
let textMaskWidth = this.moveTextNode.parent.getComponent(UITransform).width;
let moveWidth = textWidth + textMaskWidth + 50;
console.log("moveWidth:", moveWidth);
tween(this.moveTextNode)
.by(10, { position: new Vec3(-moveWidth, 0, 0) })
.call(()=>{
//恢复他的位置
this.moveTextNodeSrcPos
this.moveTextNode.setPosition(this.moveTextNodeSrcPos);//前后2段代码仅仅这里不一样
log("onComplete:",this.moveTextNode.position);
})
.start();
}
bug2:
以下代码出现unknown id
start() {
this.moveTextNodeSrcPos = new Vec3(this.moveTextNode.position.x, this.moveTextNode.position.y, this.moveTextNode.position.z);
log("this.moveTextNodeSrcPos:", this.moveTextNodeSrcPos);
this.move();
}
move() {
console.log("move");
let textWidth = this.moveTextNode.getComponent(UITransform).width;
let textMaskWidth = this.moveTextNode.parent.getComponent(UITransform).width;
let moveWidth = textWidth + textMaskWidth + 150;
console.log("moveWidth:", moveWidth);
tween(this.moveTextNode)
.by(12, { position: new Vec3(-moveWidth, 0, 0) })
.call(()=> {
console.log("aa:",this.moveTextNodeSrcPos);
})
.repeatForever()
.start();
}
bug3:
以下代码一次性瞬间打印出4个aa
tween(this.moveTextNode)
.by(12, { position: new Vec3(-moveWidth, 0, 0) })
.call(() => {
log("aa");
})
.repeat(5)
.start();
bug4:
以下代码onComplete和.call方式完全不一样
tween(this.moveTextNode)
.by(10, { position: new Vec3(-moveWidth, 0, 0) }, {
"onComplete": () => {
console.log("f");
//恢复他的位置
this.moveTextNode.setPosition(this.moveTextNodeSrcPos);
log("onComplete:", this.moveTextNode.position);
}
})
// .call(()=>{
// //恢复他的位置
// this.moveTextNode.setPosition(this.moveTextNodeSrcPos);
// log("onComplete:",this.moveTextNode.position);
// })
.repeat(5)
.start();
bug5:
以下代码直接不起作用
@property(Node)
moveTextNode: Node = null;
private moveTextNodeSrcPos: Vec3 = null;
start() {
this.moveTextNodeSrcPos = new Vec3(this.moveTextNode.position.x, this.moveTextNode.position.y, this.moveTextNode.position.z);
log("this.moveTextNodeSrcPos:", this.moveTextNodeSrcPos);
this.move();
}
move() {
console.log("move");
let textWidth = this.moveTextNode.getComponent(UITransform).width;
let textMaskWidth = this.moveTextNode.parent.getComponent(UITransform).width;
let moveWidth = textWidth + textMaskWidth + 150;
console.log("moveWidth:", moveWidth);
tween(this.moveTextNode.position)
.by(12, new Vec3(-moveWidth, 0, 0), {
"onComplete": () => {
//恢复他的位置
this.moveTextNode.setPosition(this.moveTextNodeSrcPos);
console.log("onComplete:", this.moveTextNode.position);
}
})
// .call(()=>{
// //恢复他的位置
// this.moveTextNode.setPosition(this.moveTextNodeSrcPos);
// log("onComplete:",this.moveTextNode.position);
// })
.repeatForever()
.start();
}
bug6:
代码中像下面这样设置属性值后,编辑器属性面板后期即使代码将值改为了非100.0,但是编辑器中还是显示100.0,运行后也是100.0的速度。除非在编辑器中手动修改值,然后运行时候才会显示效果出来
@property(CCFloat)
moveDeathSpeed: number = 100.0;
我就不另起帖子了,继续在这里进行bug的提供:
bug7:
这是一个小bug,多选节点和单选节点粘贴button组件成为新组件时候表现效果不同:
建议官方不要急着出正式版,我这边还在整理几个bug,非常影响我开发的bug
除了BUG就是BUG咯。。。
3.3.2指定动画播放时间就不管用,这都3.4了还是不管用。
动画状态.setTime(11)
sample.time=11
都不行。
你应该先union再repeat
实测不需要,官方文档2个以上的tween才需要用到联合union,如果只是一个,是不需要的
我都不知道官方有没有做过一个项目,或者说有没有在写代码时候做单元测试,给我的感觉就像一个永远不写单元测试一样,永远像在玩游戏一样,这些这么基础的bug都能出,而且还能跨域几个版本。。。我还能说什么
call也是action
我试下~~
_nameToState
是空的,这个是什么意思呢
请问 3.4 版本要怎么访问 box2d对象 b2
这个···是源码里,动作和名字的一个map吧
嗯,我意思是说,它影响你的实际使用吗?它的获取接口是 getState()
emmmm
就是我在代码被激活前,手动通过代码给他塞了一些clip,然后去调用 getState()
,就找不到刚塞进去的数据
你是怎么塞的?应该是要这样才行:
animation.clips = .....
你如果直接
animation.clips.push(....);
是不行的,要触发它的 setters,道理和 Node.position
一样。
我确实是push的···
感谢回复,我改下方式吧
嗯你试下吧,随时反馈
乱搞一通,照你这么搞,不如全部都不允许直接用=号赋值,直接用setXxx好了,后期继续增加这些api,那我们岂不是很难受?还需要记住哪些不能用等号,沃日