| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // 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
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class lvupcarAnim extends cc.Component {
- @property([cc.Node])
- nodeList: cc.Node[] = [];
-
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {}
- start () {
- this.schedule(()=>{
- if(this.nodeList && cc.isValid(this.nodeList[0]) && cc.isValid(this.nodeList[0]) && cc.isValid(this.nodeList[0])){
- let pos0 = this.nodeList[0].x
- let pos1 = this.nodeList[1].x
- let pos2 = this.nodeList[2].x
-
- this.nodeList[0].x = pos1
- this.nodeList[1].x = pos2
- this.nodeList[2].x = pos0
- }
-
- },0.2)
- }
-
- // update (dt) {}
- }
|