void OnDestroy() { TeamSystem.OnInitMyTeam -= HideSelf; gameUpdateLobby = null; TeamSystem.OnUpdateMyTeamInfo -= updateTeaminfo; TeamSystem.OnChangeTeam -= UpdateListTeamInfo; //InitLobbyTeamOK = null; }
private static string UpdateLobbyInfoJson(string lobbyId, string playerId, string state) { var lobbyIdJson = new UpdateLobby() { lobbyId = lobbyId, playerId = playerId, state = state }; var jsonString = JsonConvert.SerializeObject(lobbyIdJson); return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(LobbyType.update.ToString(), jsonString))); }
void Start() { InitUIText(); typeTeam = TeamSystem._teamType; team_item.SetActive(false); target_item.SetActive(false); ReBtn.gameObject.SetActive(false); wuLabel.gameObject.SetActive(false); UIManager.SetButtonEventHandler(CloseBtn.gameObject, EnumButtonEvent.OnClick, OnClickClose, 0, 0); UIManager.SetButtonEventHandler(CreateBtn.gameObject, EnumButtonEvent.OnClick, OnClickCreate, 0, 0); UIManager.SetButtonEventHandler(KuaisuBtn.gameObject, EnumButtonEvent.OnClick, OnClickKuaisu, 0, 0); //UIManager.SetButtonEventHandler (ReBtn.gameObject, EnumButtonEvent.OnClick, OnClickRe, 0, 0); gameUpdateLobby = UpdateLobbyTeam; TeamSystem.OnInitMyTeam += HideSelf; TeamSystem.OnUpdateMyTeamInfo += updateTeaminfo; TeamSystem.OnChangeTeam += UpdateListTeamInfo; ShowContingent(); AddtargetItems(); if (TeamSystem._teamType != TeamType.TT_None) { GlobalInstanceFunction.Instance.Invoke(() => { UpdateTeamTargetPosition(); }, 1); } }