TimePause.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
  7. import PopComponet from "../Template/PopComponet";
  8. const { ccclass, property } = cc._decorator;
  9. @ccclass
  10. export default class TimePause extends PopComponet {
  11. protected start(): void {
  12. let b1 = this.node.getChildByName("b1")
  13. let b2 = this.node.getChildByName("b2")
  14. let b3 = this.node.getChildByName("b3")
  15. let b4 = this.node.getChildByName("b4")
  16. cc.tween(b1)
  17. .by(0.3, { x: -264 / 2, y: -123 / 2 })
  18. .by(0.3, { x: -3000 })
  19. .start()
  20. cc.tween(b2)
  21. .by(0.3, { x: -264 / 2, y: -123 / 2 })
  22. .by(0.3, { x: -3000 })
  23. .start()
  24. cc.tween(b3)
  25. .by(0.3, { x: 264 / 2, y: 123 / 2 })
  26. .by(0.3, { x: 3000 })
  27. .start()
  28. cc.tween(b4)
  29. .by(0.3, { x: 264 / 2, y: 123 / 2 })
  30. .by(0.3, { x: 3000 })
  31. .start()
  32. this.scheduleOnce(() => {
  33. if (this.isValid) {
  34. this.Surpclose()
  35. }
  36. }, 0.6)
  37. }
  38. }