hideSelf.js 522 B

12345678910111213141516171819202122232425
  1. var Global = require("Global");
  2. var UIHelper = require("UIHelper");
  3. cc.Class({
  4. extends: cc.Component,
  5. properties: {
  6. _headInfo:null,
  7. },
  8. // LIFE-CYCLE CALLBACKS:
  9. onLoad () {
  10. UIHelper.addButtonListener(this.node.getChildByName("Mask"), this.node, "hideSelf", "onClicked");
  11. },
  12. onClicked :function(event){
  13. UIHelper.playButtonEffect("close");
  14. if(event.target.name == "Mask"){
  15. this.node.active = false;
  16. }
  17. },
  18. });