Light.ts 945 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. const { ccclass, property } = cc._decorator;
  8. @ccclass
  9. export default class Light extends cc.Component {
  10. @property(sp.Skeleton)
  11. lightAni: sp.Skeleton = null
  12. @property(sp.Skeleton)
  13. composeAni: sp.Skeleton = null
  14. // LIFE-CYCLE CALLBACKS:
  15. // onLoad () {}
  16. start() {
  17. }
  18. showLight() {
  19. //console.log('showLight')
  20. this.lightAni.node.active = true
  21. this.lightAni.setAnimation(0, 'animation', false)
  22. //this.composeAni.node.active = true
  23. //this.composeAni.setAnimation(0, 'animation', false)
  24. }
  25. // update (dt) {}
  26. }