CheckIsShowIcon.ts 1.0 KB

1234567891011121314151617181920212223242526
  1. // Learn TypeScript:
  2. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
  3. // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
  4. // Learn Attribute:
  5. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
  6. // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
  7. // Learn life-cycle callbacks:
  8. // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
  9. // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
  10. import { utils } from "./Utils";
  11. const { ccclass, property } = cc._decorator;
  12. @ccclass
  13. export default class CheckIsShowIcon extends cc.Component {
  14. onEnable() {
  15. if (utils.ServerConfig && utils.ServerConfig.show_video_icon && utils.ServerConfig.show_video_icon == "false") {
  16. this.node.active = false;
  17. } else {
  18. this.node.active = true;
  19. }
  20. }
  21. }