PowerUpUI.ts 897 B

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