Over.ts 829 B

123456789101112131415161718192021222324252627282930
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
  7. import EventName from "./EventName/EventName";
  8. import MyComponent from "./Template/MyComponent";
  9. const { ccclass, property } = cc._decorator;
  10. @ccclass
  11. export default class Over extends MyComponent {
  12. @property(cc.Label)
  13. Hight: cc.Label = null;
  14. @property(cc.Label)
  15. label: cc.Label = null;
  16. onLoad() {
  17. this.regEvent(EventName.Over, this.Over, this)
  18. }
  19. Over() {
  20. this.node.opacity = 255
  21. this.label.string = this.Hight.string
  22. }
  23. // update (dt) {}
  24. }