// Learn TypeScript: // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html import Main from "../Main"; import UiM from "../manager/UiM"; import LogUtil from "../utils/LogUtil"; const { ccclass, property } = cc._decorator; @ccclass export default class EachNodeAnim extends cc.Component { @property([cc.Node]) animList: cc.Node[] = []; private isAnim = false // LIFE-CYCLE CALLBACKS: // onLoad () {} start() { } startChildAnim() { if (this.isAnim) { return } this.isAnim = true let count = 0 let array = new Array() for (let i = 0; i < this.animList.length; i++) { array.push(this.animList[i]) } this.schedule(() => { if (cc.isValid(array[count])) { let scale = array[count].scale LogUtil.logV("startChildAnim scale",count+" : "+scale) let changeRange = 0.4 if(count== 0){ changeRange = 0.4 }else if(count== 1){ changeRange = 0.08 }else if(count == 2){ changeRange = 0.3 } array[count].runAction(cc.sequence(cc.scaleTo(0.15,scale+changeRange), cc.scaleTo(0.1, scale),cc.callFunc(()=>{ LogUtil.logV("startChildAnim scale",count+" : "+scale) }))) } count++ if(count>= array.length ){ this.isAnim = false } }, 0.1, array.length) } // update (dt) {} }