public AIController(LocalServer server) { this.server = server; Information info = Names.getRandomName(); Global.client.yourName = info.name; Global.client.yourLogo = info.logo; }
void onClick(GameObject button) { if (Global.client.audioOn) clickSound.Play(); switch (button.name) { case "local"://挑战电脑 -->直接开始游戏 Server server = new LocalServer(); server.start(); Global.client.startLocal(); Global.setSceneOld(GameScenes.GAME_SCENE); StartCoroutine(waitForStart()); break; case "friend"://挑战朋友 -->选择哪种朋友 Global.setSceneOld(GameScenes.CHOOSE_FRIEND); break; case "server"://搜寻附近朋友 -->进入搜寻界面 Global.setSceneOld(GameScenes.SEARCHING_FRIEND); server = new LanServer(); server.start(); Global.client.startServer(); StartCoroutine(waitForStart()); break; case "client"://加入附近朋友 -->开启局域网客户端 Global.client.startLan(); Global.setSceneOld(GameScenes.JOIN_FRIEND); StartCoroutine(waitForStart()); break; case "help"://挑战须知 -->游戏帮助界面 transform.parent.parent.FindChild("helpMask").gameObject.SetActive(true); break; case "setting"://设置用户头像和昵称 Global.setSceneOld(GameScenes.SETTING); break; } }