TipUI.ts 979 B

123456789101112131415161718192021222324252627282930313233
  1. /** @format */
  2. import {BaseUI} from '../BaseUI'
  3. import {ccUtils} from '../../utils/ccUtils'
  4. import {Mgr} from '../../GameControl'
  5. import {UI} from '../../enums/UI'
  6. import {SOUND} from '../../enums/Sound'
  7. const {ccclass, property} = cc._decorator
  8. @ccclass
  9. export class TipUI extends BaseUI {
  10. onShow(args, fromUI: number) {
  11. // cc.tween(this.node).set({opacity: 255, y: -100}).to(1, {opacity: 0, y: 100}).start()
  12. Mgr.audio.playSFX(SOUND.tip)
  13. ccUtils.setLabel(args, this.node, 'bg/lb')
  14. // this.node.scale = 0.2
  15. this.node.opacity = 0
  16. this.node.stopAllActions()
  17. cc.tween(this.node)
  18. .then(
  19. cc.sequence(
  20. // cc.scaleTo(0.1, 1, 1),
  21. cc.fadeIn(0.2),
  22. cc.delayTime(1.5),
  23. cc.callFunc(() => {
  24. Mgr.ui.hide(UI.TipUI)
  25. }),
  26. ),
  27. )
  28. .start()
  29. }
  30. }