Unity 5.5.2f1
I have implemented an override of OnServerStart in my GameMananager class:
public class GameManager : NetworkBehaviour
{
static GameManager _manager = null;
public static GameManager Instance { get { return _manager; } }
ShipManager _shipManager;
void Awake()
{
if (_manager == null) _manager = this;
else if(_manager != this) Destroy(gameObject);
DontDestroyOnLoad(gameObject);
_shipManager = GetComponent<ShipManager>();
}
#region Overrides of NetworkBehaviour
public override void OnStartServer()
{
base.OnStartServer();
Debug.Log("OnStartServer Running...");
_shipManager.LoadShips();
}
#endregion
}
When I run in the editor as “Host”, OnStartServer runs and my ships are created.
However, when I build and run in standalone mode, nothing happens. The log does not indicate that OnStartServer was ever called. What am I missing here?