|
|
- 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();
- }
-
-
-
-
-
- }
-
- }
|