DSIK_project/ShooterDSIK_newbac/Assets/Scripts/GetServerIp.cs
Konrad Pierzyński e1234ad7c0 Added Unity Client
2018-11-29 17:20:24 +01:00

52 lines
852 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using UnityEngine;
using UnityEngine.UI;
public class GetServerIp : MonoBehaviour
{
public Button button;
public InputField input;
public GameObject player;
public GameObject enemy;
IPAddress ip;
public IPAddress GetIP()
{
return ip;
}
private void Start()
{
ip = IPAddress.None;
}
private void Update()
{
try
{
ip = IPAddress.Parse(input.text);
}
catch (Exception e)
{
}
}
public void ButtonPressed()
{
ip = IPAddress.Parse(input.text);
gameObject.SetActive(false);
player.SetActive(true);
enemy.SetActive(true);
}
}