Class ManagedObjects
Inheritance
System.Object
ManagedObjects
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: FishNet.Runtime.dll
Syntax
public abstract class ManagedObjects
Fields
SceneObjects_Internal
Objects in currently loaded scenes. These objects can be active or inactive.
Key is the objectId while value is the object. Key is not the same as NetworkObject.ObjectId.
Declaration
protected Dictionary<ulong, NetworkObject> SceneObjects_Internal
Field Value
| Type |
Description |
| System.Collections.Generic.Dictionary<System.UInt64, NetworkObject> |
|
Spawned
NetworkObjects which are currently active.
Declaration
public Dictionary<int, NetworkObject> Spawned
Field Value
| Type |
Description |
| System.Collections.Generic.Dictionary<System.Int32, NetworkObject> |
|
Properties
NetworkManager
NetworkManager handling this.
Declaration
protected NetworkManager NetworkManager { get; }
Property Value
SceneObjects
Objects in currently loaded scenes. These objects can be active or inactive.
Key is the objectId while value is the object. Key is not the same as NetworkObject.ObjectId.
Declaration
public IReadOnlyDictionary<ulong, NetworkObject> SceneObjects { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IReadOnlyDictionary<System.UInt64, NetworkObject> |
|
Methods
AddToSceneObjects(NetworkObject)
Adds a NetworkObject to SceneObjects.
Declaration
protected void AddToSceneObjects(NetworkObject nob)
Parameters
CanPredictedDespawn(NetworkObject, NetworkConnection, Boolean, Reader)
Returns if a NetworkObject meets basic criteria for being predicted despawned.
Declaration
protected bool CanPredictedDespawn(NetworkObject nob, NetworkConnection despawner, bool asServer, Reader reader = null)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
CanPredictedSpawn(NetworkObject, NetworkConnection, Boolean, Reader)
Returns if a NetworkObject meets basic criteria for being predicted spawned.
Declaration
protected bool CanPredictedSpawn(NetworkObject nob, NetworkConnection spawner, bool asServer, Reader reader = null)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
GetNextNetworkObjectId(Boolean)
Returns the next ObjectId to use.
Declaration
protected virtual int GetNextNetworkObjectId(bool errorCheck = true)
Parameters
| Type |
Name |
Description |
| System.Boolean |
errorCheck |
|
Returns
| Type |
Description |
| System.Int32 |
|
GetSpawnedNetworkObject(Int32)
Finds a NetworkObject within Spawned.
Declaration
protected NetworkObject GetSpawnedNetworkObject(int objectId)
Parameters
| Type |
Name |
Description |
| System.Int32 |
objectId |
|
Returns
Initialize(NetworkManager)
Declaration
protected virtual void Initialize(NetworkManager manager)
Parameters
InitializePrefab(NetworkObject, Int32, Nullable<UInt16>)
Initializes a prefab, not to be mistaken for initializing a spawned object.
Declaration
public static void InitializePrefab(NetworkObject prefab, int index, ushort? collectionId = null)
Parameters
| Type |
Name |
Description |
| NetworkObject |
prefab |
Prefab to initialize.
|
| System.Int32 |
index |
Index within spawnable prefabs.
|
| System.Nullable<System.UInt16> |
collectionId |
|
ReadSceneObjectId(PooledReader, out UInt64)
Finishes reading a scene object.
Declaration
protected void ReadSceneObjectId(PooledReader reader, out ulong sceneId)
Parameters
| Type |
Name |
Description |
| PooledReader |
reader |
|
| System.UInt64 |
sceneId |
|
Reads and outputs a transforms values.
Declaration
protected void ReadTransformProperties(Reader reader, out Vector3? localPosition, out Quaternion? localRotation, out Vector3? localScale)
Parameters
| Type |
Name |
Description |
| Reader |
reader |
|
| System.Nullable<UnityEngine.Vector3> |
localPosition |
|
| System.Nullable<UnityEngine.Quaternion> |
localRotation |
|
| System.Nullable<UnityEngine.Vector3> |
localScale |
|
RemoveFromSceneObjects(NetworkObject)
Removes a NetworkObject from SceneObjects.
Declaration
protected void RemoveFromSceneObjects(NetworkObject nob)
Parameters
RemoveFromSceneObjects(UInt64)
Removes a NetworkObject from SceneObjects.
Declaration
protected void RemoveFromSceneObjects(ulong sceneId)
Parameters
| Type |
Name |
Description |
| System.UInt64 |
sceneId |
|
RemoveFromSpawned(NetworkObject, Boolean, Boolean)
Removes a NetworkedObject from spawned.
Declaration
protected virtual void RemoveFromSpawned(NetworkObject nob, bool unexpectedlyDestroyed, bool asServer)
Parameters
| Type |
Name |
Description |
| NetworkObject |
nob |
|
| System.Boolean |
unexpectedlyDestroyed |
|
| System.Boolean |
asServer |
|
SceneManager_sceneLoaded(Scene, LoadSceneMode)
Called when a scene is loaded.
Declaration
protected virtual void SceneManager_sceneLoaded(Scene s, LoadSceneMode arg1)
Parameters
| Type |
Name |
Description |
| UnityEngine.SceneManagement.Scene |
s |
|
| UnityEngine.SceneManagement.LoadSceneMode |
arg1 |
|
SkipDataLength(UInt16, PooledReader, Int32, Int32)
Tries to skip data length for a packet.
Declaration
protected void SkipDataLength(ushort packetId, PooledReader reader, int dataLength, int rpcLinkObjectId = -1)
Parameters
| Type |
Name |
Description |
| System.UInt16 |
packetId |
|
| PooledReader |
reader |
|
| System.Int32 |
dataLength |
|
| System.Int32 |
rpcLinkObjectId |
|
Writes changed transform proeprties to writer.
Declaration
protected void WriteChangedTransformProperties(NetworkObject nob, bool sceneObject, Writer headerWriter)
Parameters
WriteDespawn(NetworkObject, DespawnType, Writer)
Declaration
protected void WriteDespawn(NetworkObject nob, DespawnType despawnType, Writer everyoneWriter)
Parameters