UILoading.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { _decorator,Component,ProgressBar, tween,Node } from "cc";
  2. import { GameMng } from "../GameMng";
  3. import { UIManager } from "./UIManager";
  4. const {ccclass, property} = _decorator;
  5. @ccclass
  6. export default class UILoading extends Component {
  7. @property(Node)
  8. progress: Node = null;
  9. @property(Node)
  10. bg: Node = null;
  11. @property(Node)
  12. chess_jiang_zi: Node = null;
  13. angle:number = 180;
  14. static _time:number = -1;
  15. static deley_show(time:number){
  16. console.log("deley_show");
  17. var s = UIManager.AddPrefab(GameMng.Instance.uiloading)
  18. s.getComponent(UILoading).deley(time)
  19. return s
  20. }
  21. deley(time){
  22. this.chess_jiang_zi.active = false;
  23. this.bg.active = false;
  24. this.scheduleOnce(()=>{
  25. this.chess_jiang_zi.active = true;
  26. this.bg.active = true;
  27. },time)
  28. }
  29. start(){
  30. this.schedule(this.dt,0.01)
  31. }
  32. dt(){
  33. this.progress.angle = this.progress.angle+2
  34. }
  35. onDestroy(){
  36. this.unschedule(this.dt)
  37. }
  38. }