TrueSync
Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
TrueSync.TrueSyncManager Class Reference

Manages creation of player prefabs and lockstep execution. More...

Inheritance diagram for TrueSync.TrueSyncManager:

Static Public Member Functions

static void RunSimulation ()
 Run/Unpause the game simulation.
 
static void PauseSimulation ()
 Pauses the game simulation.
 
static void EndSimulation ()
 End the game simulation.
 
static void UpdateCoroutines ()
 Update all coroutines created.
 
static void SyncedStartCoroutine (IEnumerator coroutine)
 Starts a new coroutine. More...
 
static GameObject SyncedInstantiate (GameObject prefab)
 Instantiate a new prefab in a deterministic way. More...
 
static GameObject SyncedInstantiate (GameObject prefab, TSVector position, TSQuaternion rotation)
 Instantiates a new prefab in a deterministic way. More...
 
static GameObject SyncedInstantiate (GameObject prefab, TSVector2 position, TSQuaternion rotation)
 Instantiates a new prefab in a deterministic way. More...
 
static void SyncedDestroy (GameObject gameObject)
 Destroys a GameObject in a deterministic way. More...
 
static void SyncedDisableBehaviour (GameObject gameObject)
 Disables 'OnSyncedInput' and 'OnSyncUpdate' calls to every ITrueSyncBehaviour attached.
 
static void RegisterITrueSyncBehaviour (ITrueSyncBehaviour trueSyncBehaviour)
 Registers an implementation of ITrueSyncBehaviour to be included in the simulation. More...
 
static void RegisterIsReadyChecker (TrueSyncIsReady IsReadyChecker)
 Register a TrueSyncIsReady delegate to that returns true if the game can proceed or false otherwise. More...
 
static void RemovePlayer (int playerId)
 Removes objets related to a provided player. More...
 

Public Attributes

GameObject[] playerPrefabs
 Player prefabs to be instantiated in each machine.
 
TrueSyncConfig customConfig
 

Static Public Attributes

static TrueSyncConfig _TrueSyncGlobalConfig
 
static TrueSyncConfig TrueSyncCustomConfig = null
 

Properties

static TrueSyncConfig TrueSyncGlobalConfig [get]
 
static FP DeltaTime [get]
 Returns the deltaTime between two simulation calls.
 
static FP Time [get]
 Returns the time elapsed since the beginning of the simulation.
 
static int Ticks [get]
 Returns the number of the last simulated tick.
 
static int LastSafeTick [get]
 Returns the last safe simulated tick.
 
static TSVector Gravity [get]
 Returns the simulated gravity.
 
static List< TSPlayerInfo > Players [get]
 Returns the list of players connected.
 
static TSPlayerInfo LocalPlayer [get]
 Returns the local player.
 
static TrueSyncConfig Config [get]
 Returns the active TrueSyncConfig used by the TrueSyncManager.
 

Detailed Description

Manages creation of player prefabs and lockstep execution.

Definition at line 11 of file TrueSyncManager.cs.

Member Function Documentation

static void TrueSync.TrueSyncManager.RegisterIsReadyChecker ( TrueSyncIsReady  IsReadyChecker)
static

Register a TrueSyncIsReady delegate to that returns true if the game can proceed or false otherwise.

Parameters
IsReadyCheckerA TrueSyncIsReady delegate

Definition at line 574 of file TrueSyncManager.cs.

static void TrueSync.TrueSyncManager.RegisterITrueSyncBehaviour ( ITrueSyncBehaviour  trueSyncBehaviour)
static

Registers an implementation of ITrueSyncBehaviour to be included in the simulation.

Parameters
trueSyncBehaviourInstance of an ITrueSyncBehaviour

Definition at line 563 of file TrueSyncManager.cs.

static void TrueSync.TrueSyncManager.RemovePlayer ( int  playerId)
static

Removes objets related to a provided player.

Parameters
playerIdTarget player's id.

Definition at line 585 of file TrueSyncManager.cs.

static void TrueSync.TrueSyncManager.SyncedDestroy ( GameObject  gameObject)
static

Destroys a GameObject in a deterministic way.

The method DestroyTSRigidBody is called and attached TrueSyncBehaviors are disabled.

Parameters
rigidBodyInstance of a TSRigidBody

Definition at line 517 of file TrueSyncManager.cs.

static GameObject TrueSync.TrueSyncManager.SyncedInstantiate ( GameObject  prefab)
static

Instantiate a new prefab in a deterministic way.

Parameters
prefabGameObject's prefab to instantiate.

Definition at line 427 of file TrueSyncManager.cs.

static GameObject TrueSync.TrueSyncManager.SyncedInstantiate ( GameObject  prefab,
TSVector  position,
TSQuaternion  rotation 
)
static

Instantiates a new prefab in a deterministic way.

Parameters
prefabGameObject's prefab to instantiate.
positionPosition to place the new GameObject.
rotationRotation to set in the new GameObject.

Definition at line 438 of file TrueSyncManager.cs.

static GameObject TrueSync.TrueSyncManager.SyncedInstantiate ( GameObject  prefab,
TSVector2  position,
TSQuaternion  rotation 
)
static

Instantiates a new prefab in a deterministic way.

Parameters
prefabGameObject's prefab to instantiate.
positionPosition to place the new GameObject.
rotationRotation to set in the new GameObject.

Definition at line 506 of file TrueSyncManager.cs.

static void TrueSync.TrueSyncManager.SyncedStartCoroutine ( IEnumerator  coroutine)
static

Starts a new coroutine.

Parameters
coroutineAn IEnumerator that represents the coroutine.

Definition at line 416 of file TrueSyncManager.cs.


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