12345678910111213141516171819202122232425 |
- /** @format */
- import {BaseUI} from '../BaseUI'
- import {Mgr} from '../../GameControl'
- import {UI} from '../../enums/UI'
- const {ccclass, property} = cc._decorator
- @ccclass
- export default class FadeInOutUI extends BaseUI {
- onShow(args: any, fromUI: number) {
- let sprite = cc.find('sprite', this.node)
- let aniTime = 0.3
- let fadeAction = args.inOrOut ? cc.fadeIn(aniTime) : cc.fadeOut(aniTime)
- sprite.stopAllActions()
- sprite.opacity = args.inOrOut ? 0 : 255
- cc.tween(sprite)
- .then(fadeAction)
- .call(() => {
- Mgr.ui.hide(UI.FadeInOutUI)
- args.aniFinishFuc && args.aniFinishFuc()
- })
- .start()
- }
- }
|