LeaveControl.js 633 B

12345678910111213141516171819202122232425262728293031
  1. cc.Class({
  2. extends: cc.Component,
  3. properties:
  4. {
  5. },
  6. ctor: function(){
  7. this.m_GameClientEngine = null;
  8. },
  9. onLoad: function () {
  10. if(this.node.getChildren().length <= 0) return;
  11. },
  12. SetClientEngine: function(pClientEngine){
  13. this.m_GameClientEngine = pClientEngine;
  14. },
  15. ShowView: function(bActive){
  16. this.node.active = bActive;
  17. },
  18. OnButtonClickedBG: function()
  19. {
  20. this.node.active = false;
  21. if(this.m_GameClientEngine)
  22. this.m_GameClientEngine.OnLeaveControl(0, 0);
  23. },
  24. });