• Api Documentation
  • Manual
Show / Hide Table of Contents
  • FishNet
    • InstanceFinder
  • FishNet.Authenticating
    • Authenticator
  • FishNet.Broadcast
    • IBroadcast
  • FishNet.Broadcast.Helping
    • BroadcastHandlerBase
  • FishNet.CodeGenerating
    • AllowMutableSyncTypeAttribute
    • CustomComparerAttribute
    • DefaultDeltaReaderAttribute
    • DefaultDeltaWriterAttribute
    • DefaultReaderAttribute
    • DefaultWriterAttribute
    • ExcludeSerializationAttribute
    • IncludeSerializationAttribute
    • NotSerializerAttribute
    • ReadUnallocatedAttribute
    • UseGlobalCustomSerializerAttribute
  • FishNet.Component.Animating
    • NetworkAnimator
  • FishNet.Component.ColliderRollback
    • ColliderRollback
    • RollbackManager
    • RollbackPhysicsType
  • FishNet.Component.Observing
    • DistanceCondition
    • GridCondition
    • GridEntry
    • HashGrid
    • HashGrid.GridAxes
    • HostOnlyCondition
    • MatchCondition
    • MatchCondition.ConditionCollections
    • OwnerOnlyCondition
    • SceneCondition
  • FishNet.Component.Ownership
    • PredictedOwner
    • PredictedSpawn
  • FishNet.Component.Prediction
    • NetworkCollider
    • NetworkCollider2D
    • NetworkCollision
    • NetworkCollision2D
    • NetworkTrigger
    • NetworkTrigger2D
    • OfflineRigidbody
    • Rigidbody2DState
    • RigidbodyPauser
    • RigidbodyState
    • RigidbodyStateExtensions
    • RigidbodyStateSerializers
    • RigidbodyType
  • FishNet.Component.Scenes
    • DefaultScene
  • FishNet.Component.Spawning
    • PlayerSpawner
  • FishNet.Component.Transforming
    • DetachableNetworkTickSmoother
    • MonoTickSmoother
    • NetworkTickSmoother
    • NetworkTransform
    • NetworkTransform.ComponentConfigurationType
    • NetworkTransform.GoalData
    • NetworkTransform.RateData
    • NetworkTransform.SnappedAxes
    • NetworkTransform.TransformData
    • NetworkTransform.TransformData.ExtrapolateState
    • SynchronizedProperty
  • FishNet.Component.Utility
    • BandwidthDisplay
    • PingDisplay
  • FishNet.Connection
    • NetworkConnection
    • NetworkConnectionExtensions
  • FishNet.Managing
    • NetworkManager
    • NetworkManager.HostIterationOrder
    • NetworkManager.PersistenceType
    • NetworkManagerExtensions
    • RemoteTimeoutType
  • FishNet.Managing.Client
    • ClientManager
    • ClientObjects
  • FishNet.Managing.Debugging
    • DebugManager
  • FishNet.Managing.Logging
    • LevelLoggingConfiguration
    • LoggingConfiguration
    • LoggingType
  • FishNet.Managing.Object
    • DualPrefab
    • ManagedObjects
  • FishNet.Managing.Observing
    • ObserverManager
  • FishNet.Managing.Predicting
    • PredictionManager
    • PredictionManager.PostPhysicsSyncTransformDel
    • PredictionManager.PostReconcileDel
    • PredictionManager.PostReplicateReplayDel
    • PredictionManager.PrePhysicsSyncTransformDel
    • PredictionManager.PreReconcileDel
    • PredictionManager.PreReplicateReplayDel
    • PredictionManager.ReconcileDel
    • PredictionManager.ReplicateReplayDel
    • ReplicateStateOrder
  • FishNet.Managing.Scened
    • ClientPresenceChangeEventArgs
    • DefaultSceneProcessor
    • EmptyStartScenesBroadcast
    • LoadOptions
    • LoadParams
    • LoadQueueData
    • PreferredScene
    • ReplaceOption
    • SceneLoadData
    • SceneLoadEndEventArgs
    • SceneLoadPercentEventArgs
    • SceneLoadStartEventArgs
    • SceneLookupData
    • SceneManager
    • SceneProcessorBase
    • SceneScopeType
    • SceneUnloadData
    • SceneUnloadEndEventArgs
    • SceneUnloadStartEventArgs
    • UnloadedScene
    • UnloadOptions
    • UnloadOptions.ServerUnloadMode
    • UnloadParams
    • UnloadQueueData
  • FishNet.Managing.Server
    • ClientConnectionChangeBroadcast
    • ConnectedClientsBroadcast
    • KickReason
    • ServerManager
    • ServerObjects
  • FishNet.Managing.Statistic
    • NetworkTrafficArgs
    • NetworkTraficStatistics
    • StatisticsManager
  • FishNet.Managing.Timing
    • EstimatedTick
    • EstimatedTick.OldTickOption
    • PhysicsMode
    • PreciseTick
    • PreciseTickExtensions
    • PreciseTickSerializer
    • TickRounding
    • TickType
    • TimeManager
  • FishNet.Managing.Transporting
    • IntermediateLayer
    • LatencySimulator
    • TransportManager
  • FishNet.Managing.Utility
    • Packets
  • FishNet.Object
    • ClientAttribute
    • DataOrderType
    • DespawnType
    • EmptyNetworkBehaviour
    • GlobalPreserveOwnedObjects
    • NetworkBehaviour
    • NetworkObject
    • NetworkObject.HostVisibilityUpdatedDelegate
    • NetworkObjectIdComparer
    • NetworkPreserveOwnedObjects
    • ObserversRpcAttribute
    • ReplicateState
    • ReplicateStateExtensions
    • RpcAttribute
    • ServerAttribute
    • ServerRpcAttribute
    • TargetRpcAttribute
    • TransformProperties
    • TransformPropertiesCls
    • TransformPropertiesFlag
    • TransformPropertiesOptionExtensions
  • FishNet.Object.Prediction
    • AdaptiveInterpolationType
    • ChildTransformTickSmoother
    • IReconcileData
    • IReplicateData
    • PredictionigidbodySerializers
    • PredictionRigidbody
    • PredictionRigidbody.AllForceData
    • PredictionRigidbody.EntryData
    • PredictionRigidbody.ForceApplicationType
    • PredictionRigidbody.IForceData
    • PredictionRigidbody2D
    • PredictionRigidbody2D.AllForceData
    • PredictionRigidbody2D.EntryData
    • PredictionRigidbody2D.ForceApplicationType
    • PredictionRigidbody2D2DSerializers
    • ReconcileAttribute
    • ReplicateAttribute
  • FishNet.Object.Synchronizing
    • ByteSyncVar
    • DoubleSyncVar
    • FloatSyncVar
    • ICustomSync
    • IntSyncVar
    • LongSyncVar
    • ReadPermission
    • SbyteSyncVar
    • ShortSyncVar
    • SyncDictionary<TKey, TValue>
    • SyncHashSet<T>
    • SyncList<T>
    • SyncObjectAttribute
    • SyncStopwatch
    • SyncStopwatch.SyncTypeChanged
    • SyncStopwatchOperation
    • SyncTimer
    • SyncTimer.SyncTypeChanged
    • SyncTimerOperation
    • SyncTypeSettings
    • SyncVarAttribute
    • UIntSyncVar
    • ULongSyncVar
    • UShortSyncVar
    • Vector2IntSyncVar
    • Vector2SyncVar
    • Vector3IntSyncVar
    • Vector3SyncVar
    • Vector4SyncVar
    • WritePermission
  • FishNet.Observing
    • HostVisibilityUpdateTypes
    • NetworkObserver
    • NetworkObserver.ConditionOverrideType
    • ObserverCondition
    • ObserverConditionType
  • FishNet.Serializing
    • AutoPackType
    • DeltaSerializerOption
    • DeltaSerializerOptionExtensions
    • PooledReader
    • PooledWriter
    • Reader
    • Reader.DataSource
    • ReaderPool
    • SubStream
    • Writer
    • WriterPool
  • FishNet.Transporting
    • Channel
    • ClientConnectionStateArgs
    • ClientReceivedDataArgs
    • ConnectedClientsArgs
    • IPAddressType
    • LocalConnectionState
    • RemoteConnectionState
    • RemoteConnectionStateArgs
    • ServerConnectionStateArgs
    • ServerReceivedDataArgs
    • Transport
    • TransportConsts
  • GameKit.Dependencies.Utilities
    • ApplicationState
    • Arrays
    • BasicQueue<T>
    • Booleans
    • Bytes
    • CanvaseGroups
    • CanvasGroupBlockingType
    • CollectionCaches<T>
    • CollectionCaches<T1, T2>
    • Collider2DExtensions
    • ColliderExtensions
    • DictionaryFN
    • Disks
    • Enums
    • Floats
    • Hashing
    • Ints
    • IOs
    • IResettable
    • IWeighted
    • Layers
    • LayoutGroups
    • Materials
    • Maths
    • ObjectCaches<T>
    • Objects
    • Particles
    • PointerMonoBehaviour
    • Quaternions
    • ResettableCollectionCaches<T>
    • ResettableCollectionCaches<T1, T2>
    • ResettableObjectCaches<T>
    • ResettableT1CollectionCaches<T1, T2>
    • ResettableT2CollectionCaches<T1, T2>
    • Strings
    • Transforms
    • UInts
    • Vectors
    • WeightedRandom
  • GameKit.Dependencies.Utilities.ObjectPooling
    • ListStack<GameObject>
    • ObjectPool
    • PoolData
  • GameKit.Dependencies.Utilities.ObjectPooling.Examples
    • Projectile
    • ProjectileSpawner
  • GameKit.Dependencies.Utilities.Types
    • ByteRange
    • CanvasGroupFader
    • CanvasGroupFader.FadeGoalType
    • CanvasTracker
    • DDOL
    • FloatRange
    • FloatRange2D
    • IntRange
    • IOrderable
    • RectTransformResizer
    • RectTransformResizer.ResizeData
    • RectTransformResizer.ResizeDelegate
    • ResettableRingBuffer<T>
    • ResettableRingBuffer<T>.Enumerator
    • RingBuffer<T>
    • RingBuffer<T>.Enumerator
    • SceneAttribute
    • ScrollbarValueSetter
    • SingletonScriptableObject<T>
    • SmoothCameraTarget
    • TimedOperation
    • UIntRange
    • Vector2Range
  • GameKit.Dependencies.Utilities.Types.CanvasContainers
    • ButtonData
    • ButtonData.PressedDelegate
    • FloatingContainer
    • FloatingImage
    • ImageButtonData
    • ResizableContainer
  • GameKit.Dependencies.Utilities.Types.OptionMenuButtons
    • FloatingOptions

Class NetworkManager

Acts as a container for all things related to your networking session.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
NetworkManager
Inherited Members
UnityEngine.MonoBehaviour.IsInvoking()
UnityEngine.MonoBehaviour.CancelInvoke()
UnityEngine.MonoBehaviour.Invoke(System.String, System.Single)
UnityEngine.MonoBehaviour.InvokeRepeating(System.String, System.Single, System.Single)
UnityEngine.MonoBehaviour.CancelInvoke(System.String)
UnityEngine.MonoBehaviour.IsInvoking(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String, System.Object)
UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StartCoroutine_Auto(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(UnityEngine.Coroutine)
UnityEngine.MonoBehaviour.StopCoroutine(System.String)
UnityEngine.MonoBehaviour.StopAllCoroutines()
UnityEngine.MonoBehaviour.print(System.Object)
UnityEngine.MonoBehaviour.useGUILayout
UnityEngine.MonoBehaviour.runInEditMode
UnityEngine.Behaviour.enabled
UnityEngine.Behaviour.isActiveAndEnabled
UnityEngine.Component.GetComponent(System.Type)
UnityEngine.Component.GetComponent<T>()
UnityEngine.Component.TryGetComponent(System.Type, UnityEngine.Component)
UnityEngine.Component.TryGetComponent<T>(T)
UnityEngine.Component.GetComponent(System.String)
UnityEngine.Component.GetComponentInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInChildren(System.Type)
UnityEngine.Component.GetComponentInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentInChildren<T>()
UnityEngine.Component.GetComponentsInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInChildren(System.Type)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInChildren<T>()
UnityEngine.Component.GetComponentsInChildren<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInParent(System.Type)
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentInParent<T>()
UnityEngine.Component.GetComponentsInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInParent(System.Type)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInParent<T>()
UnityEngine.Component.GetComponents(System.Type)
UnityEngine.Component.GetComponents(System.Type, System.Collections.Generic.List<UnityEngine.Component>)
UnityEngine.Component.GetComponents<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponents<T>()
UnityEngine.Component.CompareTag(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object)
UnityEngine.Component.SendMessageUpwards(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, System.Object)
UnityEngine.Component.SendMessage(System.String)
UnityEngine.Component.SendMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object)
UnityEngine.Component.BroadcastMessage(System.String)
UnityEngine.Component.BroadcastMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.transform
UnityEngine.Component.gameObject
UnityEngine.Component.tag
UnityEngine.Object.GetInstanceID()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
UnityEngine.Object.Destroy(UnityEngine.Object)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
UnityEngine.Object.FindObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType(System.Type, System.Boolean)
UnityEngine.Object.FindObjectsByType(System.Type, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsByType(System.Type, UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type)
UnityEngine.Object.FindFirstObjectByType(System.Type)
UnityEngine.Object.FindAnyObjectByType(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type, System.Boolean)
UnityEngine.Object.FindFirstObjectByType(System.Type, UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType(System.Type, UnityEngine.FindObjectsInactive)
UnityEngine.Object.ToString()
UnityEngine.Object.name
UnityEngine.Object.hideFlags
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FishNet.Managing
Assembly: FishNet.Runtime.dll
Syntax
[DefaultExecutionOrder(-32768)]
[DisallowMultipleComponent]
[AddComponentMenu("FishNet/Manager/NetworkManager")]
public sealed class NetworkManager : MonoBehaviour

Fields

FISHNET_VERSION

Version of this release.

Declaration
public const string FISHNET_VERSION = "4.4.7"
Field Value
Type Description
System.String

Properties

ClientManager

ClientManager for this NetworkManager.

Declaration
public ClientManager ClientManager { get; }
Property Value
Type Description
ClientManager

DebugManager

DebugManager for this NetworkManager.

Declaration
public DebugManager DebugManager { get; }
Property Value
Type Description
DebugManager

Initialized

True if this instance of the NetworkManager is initialized.

Declaration
public bool Initialized { get; }
Property Value
Type Description
System.Boolean

Instances

Currently initialized NetworkManagers.

Declaration
public static IReadOnlyList<NetworkManager> Instances { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyList<NetworkManager>

IsClient

Declaration
[Obsolete("Use IsClientStarted. Note the difference between IsClientInitialized and IsClientStarted.")]
public bool IsClient { get; }
Property Value
Type Description
System.Boolean

IsClientOnly

Declaration
[Obsolete("Use IsClientOnlyStarted. Note the difference between IsClientOnlyInitialized and IsClientOnlyStarted.")]
public bool IsClientOnly { get; }
Property Value
Type Description
System.Boolean

IsClientOnlyStarted

True if only the client is started and authenticated.

Declaration
public bool IsClientOnlyStarted { get; }
Property Value
Type Description
System.Boolean

IsClientStarted

True if the client is started and authenticated.

Declaration
public bool IsClientStarted { get; }
Property Value
Type Description
System.Boolean

IsHost

Declaration
[Obsolete("Use IsHostStarted. Note the difference between IsHostInitialized and IsHostStarted.")]
public bool IsHost { get; }
Property Value
Type Description
System.Boolean

IsHostStarted

True if client and server are started.

Declaration
public bool IsHostStarted { get; }
Property Value
Type Description
System.Boolean

IsOffline

True if client nor server are started.

Declaration
public bool IsOffline { get; }
Property Value
Type Description
System.Boolean

IsServer

Declaration
[Obsolete("Use IsServerStarted. Note the difference between IsServerInitialized and IsServerStarted.")]
public bool IsServer { get; }
Property Value
Type Description
System.Boolean

IsServerOnly

Declaration
[Obsolete("Use IsServerOnlyStarted. Note the difference between IsServerOnlyInitialized and IsServerOnlyStarted.")]
public bool IsServerOnly { get; }
Property Value
Type Description
System.Boolean

IsServerOnlyStarted

True if only the server is started.

Declaration
public bool IsServerOnlyStarted { get; }
Property Value
Type Description
System.Boolean

IsServerStarted

True if server is started.

Declaration
public bool IsServerStarted { get; }
Property Value
Type Description
System.Boolean

ObjectPool

Object pool to use for this NetworkManager. Value may be null.

Declaration
public ObjectPool ObjectPool { get; }
Property Value
Type Description
FishNet.Utility.Performance.ObjectPool

ObserverManager

ObserverManager for this NetworkManager.

Declaration
public ObserverManager ObserverManager { get; }
Property Value
Type Description
ObserverManager

RollbackManager

RollbackManager for this NetworkManager.

Declaration
public RollbackManager RollbackManager { get; }
Property Value
Type Description
RollbackManager

RuntimeSpawnablePrefabs

Collection to use for spawnable objects added at runtime, such as addressables.

Declaration
public IReadOnlyDictionary<ushort, PrefabObjects> RuntimeSpawnablePrefabs { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyDictionary<System.UInt16, FishNet.Managing.Object.PrefabObjects>

SceneManager

SceneManager for this NetworkManager.

Declaration
public SceneManager SceneManager { get; }
Property Value
Type Description
SceneManager

ServerManager

ServerManager for this NetworkManager.

Declaration
public ServerManager ServerManager { get; }
Property Value
Type Description
ServerManager

SpawnablePrefabs

Collection to use for spawnable objects.

Declaration
public PrefabObjects SpawnablePrefabs { get; set; }
Property Value
Type Description
FishNet.Managing.Object.PrefabObjects

StatisticsManager

StatisticsManager for this NetworkManager.

Declaration
public StatisticsManager StatisticsManager { get; }
Property Value
Type Description
StatisticsManager

TimeManager

TimeManager for this NetworkManager.

Declaration
public TimeManager TimeManager { get; }
Property Value
Type Description
TimeManager

TransportManager

TransportManager for this NetworkManager.

Declaration
public TransportManager TransportManager { get; }
Property Value
Type Description
TransportManager

Methods

CacheObjects(NetworkObject, Int32, Boolean)

Instantiates a number of objects and adds them to the pool.

Declaration
public void CacheObjects(NetworkObject prefab, int count, bool asServer)
Parameters
Type Name Description
NetworkObject prefab

Prefab to cache.

System.Int32 count

Quantity to spawn.

System.Boolean asServer

True if storing prefabs for the server collection. This is only applicable when using DualPrefabObjects.

GetInstance<T>()

Returns class of type from registered instances. A warning will display if not found.

Declaration
public T GetInstance<T>()
    where T : Component
Returns
Type Description
T
Type Parameters
Name Description
T

Type to get.

GetPooledInstantiated(NetworkObject, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(NetworkObject prefab, bool asServer)
Parameters
Type Name Description
NetworkObject prefab
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(NetworkObject, Transform, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(NetworkObject prefab, Transform parent, bool asServer)
Parameters
Type Name Description
NetworkObject prefab
UnityEngine.Transform parent
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(NetworkObject, Vector3, Quaternion, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(NetworkObject prefab, Vector3 position, Quaternion rotation, bool asServer)
Parameters
Type Name Description
NetworkObject prefab
UnityEngine.Vector3 position
UnityEngine.Quaternion rotation
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(NetworkObject, Vector3, Quaternion, Transform, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(NetworkObject prefab, Vector3 position, Quaternion rotation, Transform parent, bool asServer)
Parameters
Type Name Description
NetworkObject prefab
UnityEngine.Vector3 position
UnityEngine.Quaternion rotation
UnityEngine.Transform parent
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(Int32, UInt16, ObjectPoolRetrieveOption, Transform, Nullable<Vector3>, Nullable<Quaternion>, Nullable<Vector3>, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(int prefabId, ushort collectionId, ObjectPoolRetrieveOption options, Transform parent, Vector3? position, Quaternion? rotation, Vector3? scale, bool asServer)
Parameters
Type Name Description
System.Int32 prefabId
System.UInt16 collectionId
FishNet.Utility.Performance.ObjectPoolRetrieveOption options
UnityEngine.Transform parent
System.Nullable<UnityEngine.Vector3> position
System.Nullable<UnityEngine.Quaternion> rotation
System.Nullable<UnityEngine.Vector3> scale
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(Int32, UInt16, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(int prefabId, ushort collectionId, bool asServer)
Parameters
Type Name Description
System.Int32 prefabId
System.UInt16 collectionId
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(Int32, UInt16, Transform, Nullable<Vector3>, Nullable<Quaternion>, Nullable<Vector3>, Boolean, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
[Obsolete("Use GetPooledInstantiated(int, ushort, RetrieveOption, parent, Vector3?, Quaternion? Vector3?, bool) instead.")]
public NetworkObject GetPooledInstantiated(int prefabId, ushort collectionId, Transform parent, Vector3? position, Quaternion? rotation, Vector3? scale, bool makeActive, bool asServer)
Parameters
Type Name Description
System.Int32 prefabId
System.UInt16 collectionId
UnityEngine.Transform parent
System.Nullable<UnityEngine.Vector3> position
System.Nullable<UnityEngine.Quaternion> rotation
System.Nullable<UnityEngine.Vector3> scale
System.Boolean makeActive

True to make the NetworkObject active if not already. Using false will not prevent an object from activating via instantation, but rather indicates to not set active manually prior to returning a NetworkObject.

System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(Int32, UInt16, Vector3, Quaternion, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(int prefabId, ushort collectionId, Vector3 position, Quaternion rotation, bool asServer)
Parameters
Type Name Description
System.Int32 prefabId
System.UInt16 collectionId
UnityEngine.Vector3 position
UnityEngine.Quaternion rotation
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(GameObject, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(GameObject prefab, bool asServer)
Parameters
Type Name Description
UnityEngine.GameObject prefab
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(GameObject, Transform, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(GameObject prefab, Transform parent, bool asServer)
Parameters
Type Name Description
UnityEngine.GameObject prefab
UnityEngine.Transform parent
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(GameObject, Vector3, Quaternion, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(GameObject prefab, Vector3 position, Quaternion rotation, bool asServer)
Parameters
Type Name Description
UnityEngine.GameObject prefab
UnityEngine.Vector3 position
UnityEngine.Quaternion rotation
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPooledInstantiated(GameObject, Vector3, Quaternion, Transform, Boolean)

Returns an instantiated or pooled object using supplied values. When a value is not specified it uses default values to the prefab or NetworkManager.

Declaration
public NetworkObject GetPooledInstantiated(GameObject prefab, Vector3 position, Quaternion rotation, Transform parent, bool asServer)
Parameters
Type Name Description
UnityEngine.GameObject prefab
UnityEngine.Vector3 position
UnityEngine.Quaternion rotation
UnityEngine.Transform parent
System.Boolean asServer
Returns
Type Description
NetworkObject

GetPrefab(Int32, Boolean)

Returns a prefab with prefabId. This method will bypass object pooling.

Declaration
public NetworkObject GetPrefab(int prefabId, bool asServer)
Parameters
Type Name Description
System.Int32 prefabId

PrefabId to get.

System.Boolean asServer

True if getting the prefab asServer.

Returns
Type Description
NetworkObject

GetPrefabIndex(GameObject, Boolean)

Gets the index a prefab uses. Can be used in conjuction with GetPrefab.

Declaration
public int GetPrefabIndex(GameObject prefab, bool asServer)
Parameters
Type Name Description
UnityEngine.GameObject prefab
System.Boolean asServer

True if to get from the server collection.

Returns
Type Description
System.Int32

Returns index if found, and -1 if not found.

GetPrefabObjects<T>(UInt16, Boolean)

Gets the PrefabObjects to use for spawnableCollectionId.

Declaration
public PrefabObjects GetPrefabObjects<T>(ushort spawnableCollectionId, bool createIfMissing)
    where T : PrefabObjects
Parameters
Type Name Description
System.UInt16 spawnableCollectionId

Id to use. 0 will return the configured SpawnablePrefabs.

System.Boolean createIfMissing

True to create and assign a PrefabObjects if missing for the collectionId.

Returns
Type Description
FishNet.Managing.Object.PrefabObjects
Type Parameters
Name Description
T

Type of PrefabObjects to return. This is also used to create an instance of type when createIfMissing is true.

HasInstance<T>()

Returns if an instance exists for type.

Declaration
public bool HasInstance<T>()
    where T : Component
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T

Type to check.

RegisterInstance<T>(T, Boolean)

Registers a new component to this NetworkManager.

Declaration
public void RegisterInstance<T>(T component, bool replace = true)
    where T : Component
Parameters
Type Name Description
T component

Reference of the component being registered.

System.Boolean replace

True to replace existing references.

Type Parameters
Name Description
T

Type to register.

RegisterInvokeOnInstance<T>(Action<Component>)

Invokes an action when a specified component becomes registered. Action will invoke immediately if already registered.

Declaration
public void RegisterInvokeOnInstance<T>(Action<Component> handler)
    where T : Component
Parameters
Type Name Description
System.Action<UnityEngine.Component> handler

Action to invoke.

Type Parameters
Name Description
T

Component type.

RemoveSpawnableCollection(UInt16)

Removes the PrefabObjects collection from memory. This should only be called after you properly disposed of it's contents properly.

Declaration
public bool RemoveSpawnableCollection(ushort spawnableCollectionId)
Parameters
Type Name Description
System.UInt16 spawnableCollectionId

CollectionId to remove.

Returns
Type Description
System.Boolean

True if collection was found and removed.

StorePooledInstantiated(NetworkObject, Boolean)

Stores an instantied object.

Declaration
public void StorePooledInstantiated(NetworkObject instantiated, bool asServer)
Parameters
Type Name Description
NetworkObject instantiated

Object which was instantiated.

System.Boolean asServer

True to store for the server.

TryGetInstance<T>(out T)

Returns class of type from registered instances.

Declaration
public bool TryGetInstance<T>(out T result)
    where T : Component
Parameters
Type Name Description
T result
Returns
Type Description
System.Boolean

True if was able to get instance.

Type Parameters
Name Description
T

Type to get.

TryRegisterInstance<T>(T)

Tries to registers a new component to this NetworkManager. This will not register the instance if another already exists.

Declaration
public bool TryRegisterInstance<T>(T component)
    where T : Component
Parameters
Type Name Description
T component

Reference of the component being registered.

Returns
Type Description
System.Boolean

True if was able to register, false if an instance is already registered.

Type Parameters
Name Description
T

Type to register.

UnregisterInstance<T>()

Unregisters a component from this NetworkManager.

Declaration
public void UnregisterInstance<T>()
    where T : Component
Type Parameters
Name Description
T

Type to unregister.

UnregisterInvokeOnInstance<T>(Action<Component>)

Removes an action to be invokes when a specified component becomes registered.

Declaration
public void UnregisterInvokeOnInstance<T>(Action<Component> handler)
    where T : Component
Parameters
Type Name Description
System.Action<UnityEngine.Component> handler

Action to invoke.

Type Parameters
Name Description
T

Component type.

Extension Methods

NetworkManagerExtensions.Log(NetworkManager, LoggingType, String)
NetworkManagerExtensions.Log(NetworkManager, String)
NetworkManagerExtensions.LogWarning(NetworkManager, String)
NetworkManagerExtensions.LogError(NetworkManager, String)
In This Article
Back to top Generated by DocFX