debug_view.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { _decorator, Component, Node, EditBox, director } from 'cc';
  2. import { Constant } from './constant';
  3. import ScenceMng from './gcommon/ScenceMng';
  4. import { UIButton } from './gcommon/UIButton';
  5. const { ccclass, property } = _decorator;
  6. @ccclass('debug_view')
  7. export class debug_view extends Component {
  8. @property(Node) ip:Node = null;
  9. @property(Node) port:Node = null;
  10. @property(Node) btn_finish:Node = null;
  11. start() {
  12. }
  13. onClick(){
  14. var ip = this.ip.getComponent(EditBox).string
  15. if(ip===""){
  16. ip = this.ip.getComponent(EditBox).placeholder
  17. }
  18. var port = this.port.getComponent(EditBox).string
  19. if(port===""){
  20. port = this.port.getComponent(EditBox).placeholder
  21. }
  22. Constant.SEVER_INFO.IP = ip
  23. Constant.SEVER_INFO.PORT = port
  24. console.log("Constant.SEVER_INFO",Constant.SEVER_INFO)
  25. director.loadScene('GameLaunch');
  26. this.btn_finish.active = false;
  27. }
  28. update(deltaTime: number) {
  29. }
  30. }