class NetworkedUnityObject (Niantic.ARDK.Networking.HLAPI.Object.Unity.NetworkedUnityObject)
Overview
A MonoBehaviour that provides replication details for a prefab/scene object. Handles details such as valid destructors, authority, and network groups for each networked object. More...
class NetworkedUnityObject: MonoBehaviour, ISerializationCallbackReceiver { public: // properties AuthBehaviour Auth; NetworkedBehaviour DefaultBehaviour; INetworkGroup?? Group; NetworkId Id; IMultipeerNetworking Networking; NetworkId PrefabId; IPeer SpawningPeer; bool WasSpawnedByMe; // methods void Initialize(); bool IsDestructionAuthorizedPeer(IPeer peer); void OnAfterDeserialize(); void OnBeforeSerialize(); };
Detailed Documentation
A MonoBehaviour that provides replication details for a prefab/scene object. Handles details such as valid destructors, authority, and network groups for each networked object.
An object with this component needs to stay alive for at least one frame after Awake, or else CallbackQueue will have a null reference to the object.
Properties
AuthBehaviour Auth
The AuthBehaviour that handles this object
NetworkedBehaviour DefaultBehaviour
The NetworkedBehaviour that determines the behaviour of the NetworkedUnityObject
INetworkGroup?? Group
The networking group that corresponds to this object, handled by the UnitySceneNetworkMaster
NetworkId Id
An Id that represents the instance of the object, shared between all peers in the session
IMultipeerNetworking Networking
The networking instance that this object is tied to
NetworkId PrefabId
An Id that represents the prefab, shared between all builds of the scene
IPeer SpawningPeer
The peer that network spawned this object, will be null if not network spawned
bool WasSpawnedByMe
Whether or not the object was spawned by the local peer
Methods
void Initialize()
Initializes the NetworkedUnityObject and all NetworkedBehaviours on the object
bool IsDestructionAuthorizedPeer(IPeer peer)
Determines if a peer has the right to destroy an object
Parameters:
peer |
The peer that would like to destroy the object |
Returns:
Whether or not the peer can destroy this object