Exemplo n.º 1
0
    public void Initialize(bool isHost)
    {
        NetworkingManager.Singleton.ConnectionApprovalCallback = ApprovalCheck;

        stateMachine = new ServerStateMachine();
        stateMachine.ChangeState(ServerModeType.Waiting);

        if (isHost)
        {
            NetworkingManager.Singleton.StartHost(EnviromentManager.Singleton.GetSpawnPosition(0));
        }
        else
        {
            NetworkingManager.Singleton.StartServer();
        }
    }