This commit is contained in:
2025-11-12 17:34:53 +08:00
parent b4fd967930
commit ae84184bf8
3 changed files with 120 additions and 13 deletions

View File

@ -384,13 +384,15 @@ class Submerge extends Tools {
move() {
if (this.TweenAnimate) {
TWEEN.remove(this.TweenAnimate)
// if (this.TweenAnimate) {
// TWEEN.remove(this.TweenAnimate)
// }
if (!this.TweenAnimate) {
let totalTime = ((this.options.maxWaterLevel - this.options.minWaterLevel) / this.options.risingSpeed) * 1000
this.TweenAnimate = new TWEEN.Tween({ waterLevel: this.options.minWaterLevel }).to({ waterLevel: this.options.maxWaterLevel }, totalTime).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(async (r, a) => {
this.currentWaterLaver = r.waterLevel
}).start()
}
let totalTime = ((this.options.maxWaterLevel - this.options.minWaterLevel) / this.options.risingSpeed) * 1000
this.TweenAnimate = new TWEEN.Tween({ waterLevel: this.options.minWaterLevel }).to({ waterLevel: this.options.maxWaterLevel }, totalTime).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(async (r, a) => {
this.currentWaterLaver = r.waterLevel
}).start()
// let contentElm = this._DialogObject._element.body
// let pauseBtn = contentElm.getElementsByClassName('pause')[0];
// let startBtn = contentElm.getElementsByClassName('start')[0];
@ -409,9 +411,9 @@ class Submerge extends Tools {
this.TweenAnimate = new TWEEN.Tween({ waterLevel: this.options.minWaterLevel }).to({ waterLevel: this.options.maxWaterLevel }, totalTime).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(async (r, a) => {
this.currentWaterLaver = r.waterLevel
}).start()
if (isPaused) {
this.pause()
}
// if (isPaused) {
this.pause()
// }
}
start() {