public void HanldeClientSelectLink() { if (NetCtrlScript == null) { NetCtrlScript = NetCtrl.GetInstance(); if (NetCtrlScript == null) { return; } } NetworkServerNet NetworkServerScript = NetworkServerNet.GetInstance(); if (NetworkServerScript != null && !NetworkServerScript.CheckIsLinkedServerPort()) { //ScreenLog.LogWarning("the client have not linked server..."); return; } if (!isHandleNetLink) { //ScreenLog.Log("link server mode"); isHandleNetLink = true; NetCtrlScript.ClientCallHandleSelectLinkCount(true); } }
void ClickStartBtEvent(ButtonState val) { //ScreenLog.Log("StartSenceChangeUI::ClickStartBtEvent -> val " + val); if (val == ButtonState.DOWN) { return; } if (Starts.activeSelf && !Leve.activeSelf) { AudioManager.Instance.PlaySFX(startAudio); } if (Starts.activeSelf && !Mode.activeSelf && !Leve.activeSelf) { //an kai shi jian TouBiScript.subPlayerCoin(); StartCoroutine(ColorCorrection(0)); Starts.SetActive(false); pcvr.StartLightStateP1 = LedState.Mie; StopCoroutine("Timer"); StartCoroutine("Tuise"); } else if (Starts.activeSelf && Mode.activeSelf) { if (!IsSelectGameMode) { Invoke("resetIsSelectGameMode", 3.0f); } IsSelectGameMode = true; //mo shi xuan ze if (GlobalData.GetInstance().gameMode == GameMode.SoloMode) { if (CanAddMusic) { // guan ka xuan ze diao luo shi de yin xiao AudioManager.Instance.PlaySFX(modeSelectAudio); CanAddMusic = false; } //ScreenLog.Log("single player mode"); StopAllCoroutines(); Mode.SetActive(false); Leve.SetActive(true); SelectObj.SetActive(true); LinkPlayerNameCtrl.GetInstance().HiddenPlayerInfo(); if (NetworkServerNet.GetInstance() != null) { NetworkServerNet.GetInstance().SetIsDisconnect(); } } else { if (NetCtrlScript == null) { //ScreenLog.LogWarning("NetCtrlScript is null"); return; } NetworkServerNet NetworkServerScript = NetworkServerNet.GetInstance(); if (NetworkServerScript != null && !NetworkServerScript.CheckIsLinkedServerPort()) { //ScreenLog.LogWarning("the client have not linked server..."); return; } if (!isHandleNetLink) { //ScreenLog.Log("link server mode"); isHandleNetLink = true; NetCtrlScript.ClientCallHandleSelectLinkCount(true); } } } }