123456789101112131415161718192021222324252627282930313233343536373839404142 |
- const GameNotificationKey = require('./utils/GameEnum').GameNotificationKey;
- cc.Class({
- extends: cc.Component,
- properties: {
- updateCoinSkeletion: sp.Skeleton,
- },
- // LIFE-CYCLE CALLBACKS:
- onLoad () {
- this.updateCoinSkeletion.node.active = false;
- this.updateCoinSkeletion.paused = true;
- this.updateCoinSkeletion.setCompleteListener(() => {
- this.updateCoinSkeletion.node.active = false;
- this.updateCoinSkeletion.paused = true;
- });
- GameEvent.on(GameNotificationKey.PlayUpdateCoinAnimation, this, (position) => {
- let canvas = cc.find('Canvas');
- let canvasPosition = canvas.convertToNodeSpaceAR(position);
- this.updateCoinSkeletion.node.position = canvasPosition;
- this.updateCoinSkeletion.paused = false;
- this.updateCoinSkeletion.node.active = true;
- this.updateCoinSkeletion.setAnimation(0, 'changjing_kz');
- });
- },
- onDestroy() {
- GameEvent.off(GameNotificationKey.PlayUpdateCoinAnimation, this);
- },
- start () {
- },
- // update (dt) {},
- });
|