This script makes it really easy to sync some value across all connected clients. Keep in mind that this script should ideally only be used for rapid prototyping. It's still better to create custom to-the-point sync scripts as they will yield better performance.
More...
|
| void | Sync () |
| | Immediately synchronize all data by sending current values to everyone else. More...
|
| |
| T | Get< T > (string name) |
| | Get the object-specific data. More...
|
| |
| T | Get< T > (string name, T defVal) |
| | Get the object-specific data. More...
|
| |
| void | Set (string name, object val) |
| | Set the object-specific data. More...
|
| |
| void | Set (string text) |
| | Convenience function to set the data using a single string notation such as "key = value". More...
|
| |
| virtual void | DestroySelf () |
| | Destroy this game object. More...
|
| |
| void | DestroySelf (float delay, bool onlyIfOwner=true) |
| | Destroy this game object on all connected clients and remove it from the server. More...
|
| |
| void | Instantiate (int rccID, string path, bool persistent, params object[] objs) |
| | Convenience method mirroring TNManager.Instantiate. Instantiate a new game object in the behaviour's channel on all connected players. More...
|
| |
| void | Instantiate (string funcName, string path, bool persistent, params object[] objs) |
| | Convenience method mirroring TNManager.Instantiate. Instantiate a new game object in the behaviour's channel on all connected players. More...
|
| |
| void | RemoveAllSavedRFCs () |
| | Immediately remove all saved RFCs. Use this if you want to clear all saved RFCs for any reason. More...
|
| |
|
System.Collections.Generic.List
< SavedEntry > | entries = new System.Collections.Generic.List<SavedEntry>() |
| | Serialized synchronized entries. More...
|
| |
| float | updatesPerSecond = 10f |
| | Maximum possible number of updates per second. If the values don't change, nothing will be sent. If to set it to zero, the value will only be synchronized when new players join. More...
|
| |
| bool | isSavedOnServer = true |
| | Whether the result will be saved on the server or not. In most cases it should remain as 'true'. In any case the values will be sent to newly joined players automatically. More...
|
| |
| bool | isImportant = true |
| | Whether to send through UDP or TCP. If it's important, TCP will be used. If not, UDP. If you have a lot of frequent updates, leave it as not important. More...
|
| |
| bool | onlyOwnerCanSync = true |
| | Whether only the object's owner can send sync messages. In most cases it should remain as 'true'. More...
|
| |
| bool | ignoreMissingTNO = false |
| |
This script makes it really easy to sync some value across all connected clients. Keep in mind that this script should ideally only be used for rapid prototyping. It's still better to create custom to-the-point sync scripts as they will yield better performance.
| override void TNet.TNAutoSync.Awake |
( |
| ) |
|
|
protectedvirtual |
Locate the property that we should be synchronizing.
Reimplemented from TNet.TNBehaviour.
| void TNet.TNAutoSync.OnDisable |
( |
| ) |
|
|
protected |
| void TNet.TNAutoSync.OnEnable |
( |
| ) |
|
|
protected |
| void TNet.TNAutoSync.Sync |
( |
| ) |
|
Immediately synchronize all data by sending current values to everyone else.
| System.Collections.Generic.List<SavedEntry> TNet.TNAutoSync.entries = new System.Collections.Generic.List<SavedEntry>() |
Serialized synchronized entries.
| bool TNet.TNAutoSync.isImportant = true |
Whether to send through UDP or TCP. If it's important, TCP will be used. If not, UDP. If you have a lot of frequent updates, leave it as not important.
| bool TNet.TNAutoSync.isSavedOnServer = true |
Whether the result will be saved on the server or not. In most cases it should remain as 'true'. In any case the values will be sent to newly joined players automatically.
| bool TNet.TNAutoSync.onlyOwnerCanSync = true |
Whether only the object's owner can send sync messages. In most cases it should remain as 'true'.
| float TNet.TNAutoSync.updatesPerSecond = 10f |
Maximum possible number of updates per second. If the values don't change, nothing will be sent. If to set it to zero, the value will only be synchronized when new players join.
The documentation for this class was generated from the following file: