Commit 7b213904 authored by Vũ Gia Vương's avatar Vũ Gia Vương

uodate time rotate HuController

parent a81242c4
...@@ -79,9 +79,9 @@ export default class HuController extends cc.Component { ...@@ -79,9 +79,9 @@ export default class HuController extends cc.Component {
private initBottle() { private initBottle() {
this._spine.setAnimation(1, "Rotate", false); this._spine.setAnimation(1, "Rotate", false);
this._spine.timeScale = this._pointStart ? 0 : 0.5; // this._spine.timeScale = this._pointStart ? 0 : 1.3;
this._track = this._spine.getState().tracks[1]; this._track = this._spine.getState().tracks[1];
this._spine.timeScale = 0; // this._spine.timeScale = 0;
} }
private onTouchStart(event: cc.Event.EventTouch): void { private onTouchStart(event: cc.Event.EventTouch): void {
...@@ -94,29 +94,28 @@ export default class HuController extends cc.Component { ...@@ -94,29 +94,28 @@ export default class HuController extends cc.Component {
private onTouchEnd(): void { private onTouchEnd(): void {
this.scheduleOnce(() => { this.scheduleOnce(() => {
this._spine.timeScale = 0; this._spine.timeScale = 0;
if (this._track.trackTime < 0) {
this._track.trackTime = this._track.animationEnd - 1e-9;
}
}, 0.5); }, 0.5);
} }
private onTouchMove(event: cc.Event.EventTouch): void { private onTouchMove(event: cc.Event.EventTouch): void {
const newPoint = event.getLocation(); const newPoint = event.getLocation();
const distance = newPoint.x - this._pointStart.x; const distance = newPoint.x - this._pointStart.x;
if (Math.abs(distance) < 5) { if (Math.abs(distance) < 10) {
this._spine.timeScale = 0; this._spine.timeScale = 0;
return; return;
} }
if (this._track.trackTime < 0) {
this._track.trackTime = this._track.animationEnd - 1e-3;
}
this._pointStart = newPoint; this._pointStart = newPoint;
this._spine.timeScale = distance > 0 ? -1.3 : 1.3; this._spine.timeScale = distance > 0 ? -1.5 : 1.5;
} }
private onRotateGuild() { private onRotateGuild() {
this._spine.timeScale = 0.5; this._spine.timeScale = 0.8;
this.scheduleOnce(() => { this.scheduleOnce(() => {
this._spine.timeScale = 0; this._spine.timeScale = 0;
}, 1.2); }, 1);
} }
private setDeviceMotion() { private setDeviceMotion() {
......
...@@ -27,7 +27,7 @@ export default class RotateTutorialController extends cc.Component { ...@@ -27,7 +27,7 @@ export default class RotateTutorialController extends cc.Component {
.to(0.5, { angle: -10 }) .to(0.5, { angle: -10 })
.to(0.5, { angle: 15 }) .to(0.5, { angle: 15 })
.call(() => eventTarget.emit(ROTATE_GUILD)) .call(() => eventTarget.emit(ROTATE_GUILD))
.to(1.2, { position: cc.v3(-150) }) .to(0.8, { position: cc.v3(-150) })
) )
.start(); .start();
} }
......
...@@ -14,8 +14,6 @@ export default class ActionScreen extends cc.Component { ...@@ -14,8 +14,6 @@ export default class ActionScreen extends cc.Component {
private _spine: sp.Skeleton = null; private _spine: sp.Skeleton = null;
onLoad() { onLoad() {
return;
eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this); eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this);
eventTarget.on(SHOW_START_SCREEN, this.hideScreen, this); eventTarget.on(SHOW_START_SCREEN, this.hideScreen, this);
eventTarget.on(PLAY_ANIM_NUT1, this.hideBottle, this); eventTarget.on(PLAY_ANIM_NUT1, this.hideBottle, this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment