Class Manus::Networking::NetObject
ClassList > Manus > Networking > NetObject
This is the Networked Object behaviour, it contains the most basic required information on a Networked Object. The NetObject has information on Ownership and Ownership changes. It keeps track of all the Syncables and helps manage data changes and gathering.
Inherits the following classes: MonoBehaviour
Public Attributes
| Type | Name | 
|---|---|
| bool | destroyOnControllerDisconnected   = = false | 
| long | m_ControllerID   = = 0 | 
| long | m_NetID   = = long.MinValue | 
| int | m_PrefabID   = = int.MinValue | 
| UnityEngine.Events.UnityEvent | onGainOwnership   | 
| UnityEngine.Events.UnityEvent | onLoseOwnership   | 
Public Properties
| Type | Name | 
|---|---|
| property bool | isOwnedByMe   Does this instance own this NetObject.  | 
| property List< Sync.BaseSync > | syncables   Get this objects syncables.  | 
Public Functions
| Type | Name | 
|---|---|
| long | GetControllerID ()  Get this object's controller ID.  | 
| Sync.BaseSync | GetSyncable (int p_Idx)  Get a syncable for a given index.  | 
| int | GetSyncableIndex (Sync.BaseSync p_Syncable)  Get a sync's Index.  | 
| bool | Initialize (long p_ID, int p_PrefabID=int.MinValue, bool p_AutoDisable=true)  Function called when initializing the object. This function should only be called by the Network Manager.  | 
| bool | IsDirty ()  Has the data changed since last Write?  | 
| void | ReceiveAllData (LidNet.NetBuffer p_Msg)  Receives and applies all the data in the Net Buffer. Assumes all the data passed in exists as Syncable.  | 
| void | ReceiveData (LidNet.NetBuffer p_Msg)  Receives and applies all the data from specific Syncables the Net Buffer.  | 
| bool | SetControllerID (long p_ControllerID, long p_MyID)  Sets the NetObject's ID, returns true if MyID owns this object.  | 
| void | WriteAllData (LidNet.NetBuffer p_Msg)  Writes all the data to the Net Buffer for sending.  | 
| void | WriteData (LidNet.NetBuffer p_Msg)  Write the dirty data to a Net Buffer for sending. Automatically sets the data to clean!  | 
Public Attributes Documentation
variable destroyOnControllerDisconnected
variable m_ControllerID
variable m_NetID
variable m_PrefabID
variable onGainOwnership
variable onLoseOwnership
Public Properties Documentation
property isOwnedByMe
property syncables
Get this objects syncables.
Returns:
A list of syncables
Public Functions Documentation
function GetControllerID
Get this object's controller ID.
Returns:
Controller ID
function GetSyncable
Get a syncable for a given index.
Returns:
Syncable, NULL when not found
function GetSyncableIndex
Get a sync's Index.
Returns:
Index
function Initialize
Function called when initializing the object. This function should only be called by the Network Manager.
inline bool Manus::Networking::NetObject::Initialize (
    long p_ID,
    int p_PrefabID=int.MinValue,
    bool p_AutoDisable=true
) 
Parameters:
p_IDObject IDp_PrefabIDPrefab IDp_AutoDisableDoes this object automatically disable itself?
Returns:
function IsDirty
Has the data changed since last Write?
Returns:
function ReceiveAllData
Receives and applies all the data in the Net Buffer. Assumes all the data passed in exists as Syncable.
Parameters:
p_Msg
function ReceiveData
Receives and applies all the data from specific Syncables the Net Buffer.
Parameters:
p_Msg
function SetControllerID
Sets the NetObject's ID, returns true if MyID owns this object.
Parameters:
p_ControllerIDp_MyID
Returns:
True if I own this object
function WriteAllData
Writes all the data to the Net Buffer for sending.
Parameters:
p_Msg
function WriteData
Write the dirty data to a Net Buffer for sending. Automatically sets the data to clean!
Parameters:
p_Msg
The documentation for this class was generated from the following file api/unity-plugin/Scripts/Networking/NetObject.cs