public void OnClickSearch() { if (string.IsNullOrEmpty(m_InputMessage.text)) { Tooltip.Instance.ShowMessageKey("CheckGuildName"); return; } C2G.GuildSearch packet = new C2G.GuildSearch(); packet.guild_name = m_InputMessage.text; Network.GameServer.JsonAsync <C2G.GuildSearch, C2G.GuildAck>(packet, OnGuildSearchHandler); }
void OnGuildSearchHandler(C2G.GuildSearch packet, C2G.GuildAck ack) { switch (ack.result) { case pe_GuildResult.Success: if (ack.guild_info == null) { Tooltip.Instance.ShowMessageKey("NotExistGuildForSearch"); return; } base.OnClose(); if (OnSearchComplete != null) { OnSearchComplete(ack.guild_info); } break; case pe_GuildResult.NotExistGuild: Tooltip.Instance.ShowMessageKey("NotExistGuildForSearch"); break; } }