24 lines
762 B
C#
24 lines
762 B
C#
using System.Collections.Generic;
|
|
using Unity.NetCode;
|
|
|
|
namespace EE2Clone.NetCode
|
|
{
|
|
/// <summary>
|
|
/// Custom bootstrap that prevents automatic world creation.
|
|
/// We manually create client/server worlds when the player chooses to host or connect.
|
|
/// </summary>
|
|
[UnityEngine.Scripting.Preserve]
|
|
public class GameBootstrap : ClientServerBootstrap
|
|
{
|
|
public override bool Initialize(string defaultWorldName)
|
|
{
|
|
// Create only the default (local) world on startup.
|
|
// Client and server worlds are created manually when the user
|
|
// starts hosting or joins a game.
|
|
AutoConnectPort = 0;
|
|
CreateDefaultClientServerWorlds();
|
|
return true;
|
|
}
|
|
}
|
|
}
|