An open API service indexing awesome lists of open source software.

https://github.com/xjine/unity_ipendpointinfo

IPEndPoint wrapper to setup from Inspector.
https://github.com/xjine/unity_ipendpointinfo

assets unity

Last synced: about 1 month ago
JSON representation

IPEndPoint wrapper to setup from Inspector.

Awesome Lists containing this project

README

          

# Unity_IPEndPointInfo

IPEndPoint wrapper to setup from Inspector.

## Importing

You can use Package Manager or import it directly.

```
https://github.com/XJINE/Unity_IPEndPointInfo.git?path=Assets/Packages/IPEndPointInfo
```

## How to Use

Set ``address`` and ``port`` field. And get ``IPEndPoint`` from property.
The source is quite simple.

```csharp
[SerializeField] private string address;
[SerializeField] private int port;

private IPEndPoint _ipEndPoint;

public string Address
{
get => address;
set
{
address = value;
_ipEndPoint = new IPEndPoint(IPAddress.Parse(address), port);
}
}
public int Port
{
get => port;
set
{
port = value;
_ipEndPoint = new IPEndPoint(IPAddress.Parse(address), port);
}
}

public IPEndPoint IPEndPoint => _ipEndPoint ??= new IPEndPoint(IPAddress.Parse(address), port);
```