123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import { _decorator,Component,ProgressBar, tween,Node } from "cc";
- import { GameMng } from "../GameMng";
- import { UIManager } from "./UIManager";
- const {ccclass, property} = _decorator;
- @ccclass
- export default class UILoading extends Component {
- @property(Node)
- progress: Node = null;
- @property(Node)
- bg: Node = null;
- @property(Node)
- chess_jiang_zi: Node = null;
-
- angle:number = 180;
- static _time:number = -1;
- static deley_show(time:number){
- console.log("deley_show");
- var s = UIManager.AddPrefab(GameMng.Instance.uiloading)
- s.getComponent(UILoading).deley(time)
- return s
- }
- deley(time){
- this.chess_jiang_zi.active = false;
- this.bg.active = false;
- this.scheduleOnce(()=>{
- this.chess_jiang_zi.active = true;
- this.bg.active = true;
- },time)
- }
-
- start(){
- this.schedule(this.dt,0.01)
- }
-
- dt(){
- this.progress.angle = this.progress.angle+2
- }
- onDestroy(){
- this.unschedule(this.dt)
- }
- }
|