UnityEngine.Networking.NetworkDiscovery.OnGUI C# (CSharp) Method

OnGUI() private method

private OnGUI ( ) : void
return void
        private void OnGUI()
        {
            if (this.m_ShowGUI)
            {
                int num = 10 + this.m_OffsetX;
                int num2 = 40 + this.m_OffsetY;
                if (Application.platform == RuntimePlatform.WebGLPlayer)
                {
                    GUI.Box(new Rect((float) num, (float) num2, 200f, 20f), "( WebGL cannot broadcast )");
                }
                else if (this.m_MsgInBuffer == null)
                {
                    if (GUI.Button(new Rect((float) num, (float) num2, 200f, 20f), "Initialize Broadcast"))
                    {
                        this.Initialize();
                    }
                }
                else
                {
                    string str = "";
                    if (this.m_IsServer)
                    {
                        str = " (server)";
                    }
                    if (this.m_IsClient)
                    {
                        str = " (client)";
                    }
                    GUI.Label(new Rect((float) num, (float) num2, 200f, 20f), "initialized" + str);
                    num2 += 0x18;
                    if (this.m_Running)
                    {
                        if (GUI.Button(new Rect((float) num, (float) num2, 200f, 20f), "Stop"))
                        {
                            this.StopBroadcast();
                        }
                        num2 += 0x18;
                        if (this.m_BroadcastsReceived != null)
                        {
                            foreach (string str2 in this.m_BroadcastsReceived.Keys)
                            {
                                NetworkBroadcastResult result = this.m_BroadcastsReceived[str2];
                                if (GUI.Button(new Rect((float) num, (float) (num2 + 20), 200f, 20f), "Game at " + str2) && this.m_UseNetworkManager)
                                {
                                    char[] separator = new char[] { ':' };
                                    string[] strArray = BytesToString(result.broadcastData).Split(separator);
                                    if (((strArray.Length == 3) && (strArray[0] == "NetworkManager")) && ((NetworkManager.singleton != null) && (NetworkManager.singleton.client == null)))
                                    {
                                        NetworkManager.singleton.networkAddress = strArray[1];
                                        NetworkManager.singleton.networkPort = Convert.ToInt32(strArray[2]);
                                        NetworkManager.singleton.StartClient();
                                    }
                                }
                                num2 += 0x18;
                            }
                        }
                    }
                    else
                    {
                        if (GUI.Button(new Rect((float) num, (float) num2, 200f, 20f), "Start Broadcasting"))
                        {
                            this.StartAsServer();
                        }
                        num2 += 0x18;
                        if (GUI.Button(new Rect((float) num, (float) num2, 200f, 20f), "Listen for Broadcast"))
                        {
                            this.StartAsClient();
                        }
                        num2 += 0x18;
                    }
                }
            }
        }