Skip to main content

Interface IObjectOwner

An object that can own networked objects

Syntax
public interface IObjectOwner

Properties

Identity

The main object owned by this player, normally the player's character

Declaration
NetworkIdentity Identity { get; set; }

HasCharacter

Declaration
bool HasCharacter { get; }

OwnedObjects

All the objects owned by the player

Declaration
IReadOnlyCollection<NetworkIdentity> OwnedObjects { get; }

Methods

AddOwnedObject(NetworkIdentity)

Declaration
void AddOwnedObject(NetworkIdentity networkIdentity)
Parameters
TypeNameDescription
Mirage.NetworkIdentitynetworkIdentity

RemoveOwnedObject(NetworkIdentity)

Declaration
void RemoveOwnedObject(NetworkIdentity networkIdentity)
Parameters
TypeNameDescription
Mirage.NetworkIdentitynetworkIdentity

RemoveAllOwnedObject(Boolean)

Removes all owned objects. This is useful to call when player disconnects to avoid objects being destroyed

Declaration
void RemoveAllOwnedObject(bool sendAuthorityChangeEvent)
Parameters
TypeNameDescription
System.BooleansendAuthorityChangeEventShould message be send to owner client? If player is disconnecting you should set this false

DestroyOwnedObjects()

Destroys or unspawns all owned objects. This is called when the player is disconnects. It will be called after , so Disconnected can be used to remove any owned objects from the list before they are destroyed.

Declaration
void DestroyOwnedObjects()