try
{
string sHostName = System.Net.Dns.GetHostName();
System.Net.IPHostEntry ipE = System.Net.Dns.GetHostEntry(sHostName);
System.Net.IPAddress[] IpA = ipE.AddressList;
labelIP.text = "Your I.P.: " + IpA[0].ToString();
}
catch (System.Exception e)
{
Debug.LogWarning("tried to read IP but smth failed " + e.Message);
labelIP.text = "Offline";
}