|
@@ -202,7 +202,8 @@ export class NestPlay extends cc.Component {
|
|
// modleNode.setPosition(cc.v2(0,0));
|
|
// modleNode.setPosition(cc.v2(0,0));
|
|
|
|
|
|
let ani = aniNode.addComponent(cc.Animation);
|
|
let ani = aniNode.addComponent(cc.Animation);
|
|
- ani.addClip(this.aniClip[cnt], 'path')
|
|
|
|
|
|
+ let state = ani.addClip(this.aniClip[cnt], 'path')
|
|
|
|
+ // cc.log('@@ ', state);
|
|
ani.play('path').speed = 0.3;
|
|
ani.play('path').speed = 0.3;
|
|
|
|
|
|
ani.once(cc.Animation.EventType.FINISHED, ()=>{
|
|
ani.once(cc.Animation.EventType.FINISHED, ()=>{
|
|
@@ -260,8 +261,14 @@ export class NestPlay extends cc.Component {
|
|
parent.addChild(aniNode);
|
|
parent.addChild(aniNode);
|
|
|
|
|
|
let ani = aniNode.addComponent(cc.Animation);
|
|
let ani = aniNode.addComponent(cc.Animation);
|
|
|
|
+ // ani.addClip(this.aniClip[cnt], 'path')
|
|
ani.addClip(this.aniClip[cnt], 'path')
|
|
ani.addClip(this.aniClip[cnt], 'path')
|
|
- ani.play('path').speed = 0.3;
|
|
|
|
|
|
+
|
|
|
|
+ let state = ani.play('path');
|
|
|
|
+ let extent = Utils.getAniExtent(state);
|
|
|
|
+ let d = state.duration;
|
|
|
|
+ state.speed = state.duration / (extent / 200);
|
|
|
|
+ // cc.log('@@ ',extent + '|', d, state.duration, state.speed);
|
|
|
|
|
|
ani.once(cc.Animation.EventType.FINISHED, ()=>{
|
|
ani.once(cc.Animation.EventType.FINISHED, ()=>{
|
|
cnt++;
|
|
cnt++;
|