You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

42 lines
813 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
namespace Networking.Server
{
/// <summary>
/// Component to control server
/// </summary>
public class ServerManager : MonoBehaviour
{
#region Inspector Fields
[Header("Server Settings")]
[SerializeField]
private int Port;
[SerializeField]
private bool StartServerOnAwake;
[Header("References")]
[SerializeField]
private ServerObject Server;
#endregion Inspector Fields
private void Awake()
{
if (StartServerOnAwake)
Server.StartServer(Port);
}
private void Update()
{
Server.ServerUpdate();
}
}
}