WithdrawalWidget.ts 801 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { utils } from "./Utils";
  2. import WithdrawalNode from "./WithdrawalNode";
  3. const { ccclass, property } = cc._decorator;
  4. @ccclass
  5. export default class WithdrawalWidget extends cc.Component {
  6. @property(cc.Prefab)
  7. withdrawalPanel: cc.Prefab = null;
  8. _withdrawalNode: WithdrawalNode = null;
  9. _isInit: boolean = false;
  10. onLoad() {
  11. this._withdrawalNode = this.getComponentInChildren("WithdrawalNode");
  12. this._withdrawalNode.node.active = false;
  13. }
  14. onEnable() {
  15. utils.registerServerInitEvent(() => {
  16. this._initWidget();
  17. }, this);
  18. }
  19. onDisable() {
  20. utils.unregisterServerInitEvent(this);
  21. }
  22. _initWidget() {
  23. this._withdrawalNode.node.active = true;
  24. // this._withdrawalNode.init({});
  25. }
  26. }