simplified network setup
This commit is contained in:
24
Unity-Master/Assets/Scripts/NetworkConfig.cs
Normal file
24
Unity-Master/Assets/Scripts/NetworkConfig.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "NetworkConfig", menuName = "Config/Network Config")]
|
||||
public class NetworkConfig : ScriptableObject
|
||||
{
|
||||
[Header("Global Network Settings")]
|
||||
public string ipAddress = "127.0.0.1";
|
||||
public int port = 8080;
|
||||
|
||||
private static NetworkConfig _instance;
|
||||
public static NetworkConfig Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = Resources.Load<NetworkConfig>("NetworkConfig");
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user