Files
EE2Clone/Assets/Scripts/NetCode/GameBootstrap.cs
ldbetteridge 58da5d1d71 Initial import
2026-03-31 15:59:23 +01:00

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