GameOverMediator.ts 656 B

123456789101112131415161718192021222324252627282930313233
  1. import { _decorator, Component, Node } from 'cc';
  2. import { GUIMediator } from '../../../engines/gui/GUIMediator';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('GameOverMediator')
  5. export class GameOverMediator extends GUIMediator {
  6. @property(Node)
  7. WinGroup:Node=null;
  8. @property(Node)
  9. DefeatedGroup:Node=null;
  10. onLoad(){
  11. }
  12. OnShow(data?:any):void{
  13. super.OnShow(data);
  14. let isWin:boolean=data;
  15. this.WinGroup.active=isWin;
  16. this.DefeatedGroup.active=!isWin;
  17. //胜利
  18. if(data==true){
  19. }else{//失败
  20. }
  21. }
  22. OnHide():void{
  23. }
  24. }