// Learn TypeScript: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html import EventName from "../EventName/EventName"; import PopComponet from "../Template/PopComponet"; import PopManger from "./PopManger"; const { ccclass, property } = cc._decorator; @ccclass export default class StartAnim extends PopComponet { //让这个动画播放最小的时间 BeastShortTime = 1// 1500 onLoad(): void { //重写父类 不删除这个 函数 } start() { for (let index = 0; index < this.node.childrenCount; index++) { let item = this.node.getChildByName("item" + index) cc.tween(item).repeatForever( cc.tween() .by(1, { x: 600 }) ).start(); } let StartTime = cc.sys.now() this.scheduleOnce(() => { if (this.isValid) { PopManger.getInstance().LoadGameScene().then( (result) => { if (result == true) { let XC_Time = cc.sys.now() - StartTime if ((XC_Time) < this.BeastShortTime) { setTimeout(() => { PopManger.getInstance().loadScene_Game() }, this.BeastShortTime - XC_Time); } else { PopManger.getInstance().loadScene_Game() } } } ) } }, 0) } }