NetRigidbodyManager - maceeikodev/WreckMP_Ref GitHub Wiki
Definition
public static class NetRigidbodyManager
Rigidbody manager required to sync your rigidbodies.
Static methods
public static WreckAPI.OwnedRigidbody RegisterRigidbody(this Rigidbody rb, int hash);
Register a rigidbody. Do NOT register rigidbodies created in PreLoad / OnLoad / PostLoad! They are registered automatically.
rb
- The rigidbody to register.
hash
- Unique hash to identify the rigibody.
Returns: The newly created and registered WreckAPI.OwnedRigidbody object. In singleplayer returns dummy instance which only references the passed rigidbody.
public static WreckAPI.OwnedRigidbody GetOwnedRigidbody(int hash);
Get WreckAPI.OwnedRigidbody by its hash.
hash
- The hash of the requested rigidbody.
Returns: The requested WreckAPI.OwnedRigidbody, if found, otherwise null. In singleplayer returns null.
public static int GetRigidbodyHash(this Rigidbody rb);
Get a hash of a rigidbody.
rb
- The rigidbody to look for.
Returns: The hash of the requested rigidbody, if found, otherwise 0.
public static void RequestOwnership(this Rigidbody rigidbody);
public static void RequestOwnership(this WreckAPI.OwnedRigidbody orb);
Set a rigidbody's owner to local player.
rigidbody
- The rigidbody to change owner of.
orb
- The WreckAPI.OwnedRigidbody to change owner of.