我就想缓动一个number类型的变量,用tween怎么写啊
我试了下,如图:

但是打印出来一直是0,并非是想要的2秒内从0变到5,请教各位大佬正确的写法
private _tt: number = 0;
public get tt() {
return this._tt;
}
public set tt(t: number) {
this._tt = t;
}
func() {
cc.tween(this).to(1, {tt: 10}).start();
}
cc.tween(<类名>this).to(1, {tt: 10}).start();
可以正常运行了.虽然不知道为啥这样写. 多谢多谢!
从一个值类型,变成了引用类型,就可以动态的修改了
原来如此, 厉害
