|
@@ -60,7 +60,7 @@ export class CocktailCup extends Component {
|
|
|
async addLayer() {
|
|
|
this.currentLayers++;
|
|
|
this.playAnimationByState(CocktailCupState.GetWater);
|
|
|
- await GameUtil.delay(0.5);
|
|
|
+ await GameUtil.delay(0.4);
|
|
|
await this.checkAndDestroy();
|
|
|
}
|
|
|
|
|
@@ -100,6 +100,7 @@ export class CocktailCup extends Component {
|
|
|
|
|
|
switch (state) {
|
|
|
case CocktailCupState.GetWater:
|
|
|
+ this.setSpineTimeScale(1.5);
|
|
|
allNodes.forEach(child => child.getComponent(sp.Skeleton)!.setAnimation(0, `pour_0${this.currentLayers}`, false));
|
|
|
break;
|
|
|
case CocktailCupState.Move:
|
|
@@ -115,6 +116,15 @@ export class CocktailCup extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //设置spine 时间缩放率
|
|
|
+ setSpineTimeScale(timeScale: number = 1) {
|
|
|
+ if (!this.node) return;
|
|
|
+ const spineComponents = this.node.getComponentsInChildren(sp.Skeleton);
|
|
|
+ spineComponents.forEach(spine => {
|
|
|
+ spine.timeScale = timeScale;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
protected onDestroy(): void {
|
|
|
EventDispatcher.instance.emit(GameEvent.EVENT_REFRESH_REMAIN_CUP);
|
|
|
}
|