Class OverrideAutomaticNetcodeBootstrap
Add this to your Scene (on a root GameObject only!) to replace the automatic bootstrapping setting specified in your NetCodeConfig ProjectSettings asset. Note: Netcode will only search the Active scene for this MonoBehaviour, and only during bootstrap (which occurs only on game boot, before the first MonoBehaviour Awake).
Implements
Inherited Members
Component.GetComponentIndex()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Scene)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public sealed class OverrideAutomaticNetcodeBootstrap : MonoBehaviour, IComparable<OverrideAutomaticNetcodeBootstrap>
Remarks
Our Unity.Entities.ICustomBootstrap (ClientServerBootstrap) will use the first one it finds in any scenes. 2 (or more) will err. Also note: This will not work if you use your own bootstrapper, unless you call DetermineIfBootstrappingEnabled(bool) early, and return false if false.
Fields
ForceAutomaticBootstrapInScene
ClientServerBootstrap to either be EnableAutomaticBootstrap or DisableAutomaticBootstrap.
Declaration
[Tooltip("Note: This will only replace the bootstrap for this one scene, and only if this scene is the Active scene when entering playmode, or the first scene in the build.")]
public NetCodeConfig.AutomaticBootstrapSetting ForceAutomaticBootstrapInScene
Field Value
Type | Description |
---|---|
NetCodeConfig.AutomaticBootstrapSetting |