TNet 3  3.0.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
TNet.TNSyncRigidbody Class Reference

This script makes it easy to sync rigidbodies across the network. Use this script on all the objects in your scene that have a rigidbody and can move as a result of physics-based interaction with other objects. Note that any user-based interaction (such as applying a force of any kind) should still be sync'd via an explicit separate RFC call for optimal results. More...

Inheritance diagram for TNet.TNSyncRigidbody:
TNet.TNBehaviour

Public Member Functions

void Sync ()
 Send out an update to everyone on the network. More...
 
- Public Member Functions inherited from TNet.TNBehaviour
Get< T > (string name)
 Get the object-specific data. More...
 
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...
 

Public Attributes

float updatesPerSecond = 10f
 How many times per second to send updates. The actual number of updates sent may be higher (if new players connect) or lower (if the rigidbody is still). More...
 
bool isImportant = false
 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, mark it as not important. More...
 
bool isActive = true
 Set this to 'false' to stop sending updates. More...
 
- Public Attributes inherited from TNet.TNBehaviour
bool ignoreMissingTNO = false
 

Protected Member Functions

override void Awake ()
 Cache the TNObject if it exists. More...
 
- Protected Member Functions inherited from TNet.TNBehaviour
virtual void Start ()
 Create the TNObject if it hasn't been found already. More...
 
void CreateTNObject ()
 Create the TNObject. More...
 

Additional Inherited Members

- Properties inherited from TNet.TNBehaviour
TNObject tno [get]
 

Detailed Description

This script makes it easy to sync rigidbodies across the network. Use this script on all the objects in your scene that have a rigidbody and can move as a result of physics-based interaction with other objects. Note that any user-based interaction (such as applying a force of any kind) should still be sync'd via an explicit separate RFC call for optimal results.

Member Function Documentation

override void TNet.TNSyncRigidbody.Awake ( )
protectedvirtual

Cache the TNObject if it exists.

Reimplemented from TNet.TNBehaviour.

void TNet.TNSyncRigidbody.Sync ( )

Send out an update to everyone on the network.

Member Data Documentation

bool TNet.TNSyncRigidbody.isActive = true

Set this to 'false' to stop sending updates.

bool TNet.TNSyncRigidbody.isImportant = false

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, mark it as not important.

float TNet.TNSyncRigidbody.updatesPerSecond = 10f

How many times per second to send updates. The actual number of updates sent may be higher (if new players connect) or lower (if the rigidbody is still).


The documentation for this class was generated from the following file: