|
@@ -405,7 +405,7 @@ export default class GuideRule extends cc.Component {
|
|
|
}
|
|
|
return audios
|
|
|
}
|
|
|
- playAni() {
|
|
|
+ playAni(noDelay: boolean = false) {
|
|
|
if (this.playState == PLAY_STATE.start) {
|
|
|
this.playState = PLAY_STATE.playing
|
|
|
let aniEnd = this.dataJson.ani == ''
|
|
@@ -434,7 +434,7 @@ export default class GuideRule extends cc.Component {
|
|
|
let allActionTweenIndex = 0
|
|
|
for (let customAction of action.actions) {
|
|
|
let actionTween = t()
|
|
|
- .delay(customAction.startDelay)
|
|
|
+ .delay(noDelay ? 0 : customAction.startDelay)
|
|
|
.call(() => {
|
|
|
for (let audio of customAction.audios) {
|
|
|
if (audio.audioName) {
|
|
@@ -543,23 +543,24 @@ export default class GuideRule extends cc.Component {
|
|
|
}
|
|
|
})
|
|
|
} else if (customAction.actionType == ACT_TYPE.shake) {
|
|
|
+ let shakeTime = 0.05
|
|
|
actionTween.then(
|
|
|
t().repeat(
|
|
|
- Math.ceil(customAction.runTime / 0.5),
|
|
|
+ Math.ceil((customAction.runTime / shakeTime) * 10),
|
|
|
t()
|
|
|
- .by(0.05, {x: 5, y: 7})
|
|
|
- .by(0.05, {x: -6, y: -7})
|
|
|
- .by(0.05, {x: 6, y: 3})
|
|
|
- .by(0.05, {x: 3, y: -5})
|
|
|
- .by(0.05, {x: -5, y: 5})
|
|
|
- .by(0.05, {x: 2, y: -3})
|
|
|
- .by(0.05, {x: -8, y: -10})
|
|
|
- .by(0.05, {x: 3, y: 10})
|
|
|
- .by(0.05, {x: 0, y: 0}),
|
|
|
+ .by(shakeTime, {x: 5, y: 7})
|
|
|
+ .by(shakeTime, {x: -6, y: -7})
|
|
|
+ .by(shakeTime, {x: 6, y: 3})
|
|
|
+ .by(shakeTime, {x: 3, y: -5})
|
|
|
+ .by(shakeTime, {x: -5, y: 5})
|
|
|
+ .by(shakeTime, {x: 2, y: -3})
|
|
|
+ .by(shakeTime, {x: -8, y: -10})
|
|
|
+ .by(shakeTime, {x: 3, y: 10})
|
|
|
+ .by(shakeTime, {x: 0, y: 0}),
|
|
|
),
|
|
|
)
|
|
|
}
|
|
|
- actionTween.delay(customAction.endDelay)
|
|
|
+ actionTween.delay(noDelay ? 0 : customAction.endDelay)
|
|
|
if (lastSequence != customAction.isSequence) {
|
|
|
lastSequence = customAction.isSequence
|
|
|
allActionTweenIndex += 1
|
|
@@ -583,13 +584,13 @@ export default class GuideRule extends cc.Component {
|
|
|
manyActionTween.parallel(manyActionTweenArr.tween[0], ...manyActionTweenArr.tween.splice(1))
|
|
|
}
|
|
|
}
|
|
|
- let unionTween = t().delay(action.startDelay)
|
|
|
+ let unionTween = t().delay(noDelay ? 0 : action.startDelay)
|
|
|
if (action.repeat > 0) {
|
|
|
unionTween.repeat(action.repeat, manyActionTween)
|
|
|
} else {
|
|
|
unionTween.then(manyActionTween)
|
|
|
}
|
|
|
- unionTween.delay(action.endDelay)
|
|
|
+ unionTween.delay(noDelay ? 0 : action.endDelay)
|
|
|
if (lastUnionSequence != action.isSequence) {
|
|
|
lastUnionSequence = action.isSequence
|
|
|
allUnionActionIndex += 1
|
|
@@ -599,7 +600,7 @@ export default class GuideRule extends cc.Component {
|
|
|
}
|
|
|
allUnionActionArr[allUnionActionIndex].tween.push(unionTween)
|
|
|
}
|
|
|
- let allUnionAction = t().delay(this.dataJson.actionTagDelayTime)
|
|
|
+ let allUnionAction = t().delay(noDelay ? 0 : this.dataJson.actionTagDelayTime)
|
|
|
for (let manyUnionAction of allUnionActionArr) {
|
|
|
if (manyUnionAction.lastUnionSequence || manyUnionAction.tween.length <= 1) {
|
|
|
for (let tempAction of manyUnionAction.tween) {
|
|
@@ -659,7 +660,10 @@ export default class GuideRule extends cc.Component {
|
|
|
editorPlayAudio(url) {
|
|
|
if (!CC_EDITOR) return
|
|
|
ccUtils.editorLoadSync(PathUtils.addSGP(url + '.mp3', GAME_SEME_TYPE[this.guideUI.gameType], 1)).then(clip => {
|
|
|
- cc.audioEngine.playEffect(clip, false)
|
|
|
+ let id = cc.audioEngine.playEffect(clip, false)
|
|
|
+ cc.audioEngine.setFinishCallback(id, () => {
|
|
|
+ cc.audioEngine.uncache(clip)
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|