| 123456789101112131415161718192021222324252627282930313233343536 |
- // 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 Light extends cc.Component {
- @property(sp.Skeleton)
- lightAni: sp.Skeleton = null
-
- @property(sp.Skeleton)
- composeAni: sp.Skeleton = null
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {}
- start() {
- }
- showLight() {
- //console.log('showLight')
- this.lightAni.node.active = true
- this.lightAni.setAnimation(0, 'animation', false)
- //this.composeAni.node.active = true
- //this.composeAni.setAnimation(0, 'animation', false)
- }
- // update (dt) {}
- }
|