Photon Quantum 3.0.0

Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Quantum.QuantumCallbacks Class Reference

A legacy way to hook into Quantum game callbacks. Use the publish subscribe pattern used by QuantumCallbacks instead. To use this callback class, derive from it and implement the methods you are interested in. The callback MonoBehaviour has to be added to the scene to work. More...

Inheritance diagram for Quantum.QuantumCallbacks:
Quantum.QuantumMonoBehaviour

Public Member Functions

virtual void OnChecksumError (QuantumGame game, DeterministicTickChecksumError error, Frame[] frames)
 Is called by CallbackChecksumError when a checksum error is detected. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on. More...
 
virtual void OnGameDestroyed (QuantumGame game)
 Is called by CallbackGameDestroyed when the session has been destroyed."/> More...
 
virtual void OnGameInit (QuantumGame game, bool isResync)
 Is called by CallbackGameInit during QuantumGame.OnGameStart(DeterministicFrame) when the game is about to start. More...
 
virtual void OnGameResync (QuantumGame game)
 Is called by CallbackGameResynced during QuantumGame.OnGameResync when the game has been re-synchronized from a snapshot and is about to start. More...
 
virtual void OnGameStart (QuantumGame game)
 Obsolete: use other OnGameStart overload. More...
 
virtual void OnGameStart (QuantumGame game, bool isResync)
 Is called by CallbackGameStarted during QuantumGame.OnGameStart or QuantumGame.OnGameResync" when the game is started after systems are initialized and the snapshot has arrived for late-joining clients. More...
 
virtual void OnSimulateFinished (QuantumGame game, Frame frame)
 Is called by CallbackSimulateFinished after completing the simulation of a frame. More...
 
virtual void OnUnitySceneLoadBegin (QuantumGame game)
 Is called by CallbackUnitySceneLoadBegin when a Unity scene is about to be loaded. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on. More...
 
virtual void OnUnitySceneLoadDone (QuantumGame game)
 Is called by CallbackUnitySceneLoadDone when a Unity scene has been loaded. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on. More...
 
virtual void OnUnitySceneUnloadBegin (QuantumGame game)
 Is called by CallbackUnitySceneUnloadBegin when a Unity scene is about to be unloaded. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on. More...
 
virtual void OnUnitySceneUnloadDone (QuantumGame game)
 Is called by CallbackUnitySceneUnloadDone when a Unity scene has been unloaded. More...
 
virtual void OnUpdateView (QuantumGame game)
 Is called by CallbackUpdateView which is originally called by QuantumRunner.Update and it is called every Unity frame. More...
 

Static Public Attributes

static readonly List< QuantumCallbacksInstances = new List<QuantumCallbacks>()
 Static list of all instances of QuantumCallbacks to call on Quantum callbacks. Populated on OnEnable and OnDisable. More...
 

Protected Member Functions

virtual void OnDisable ()
 Unity OnDisable event removes itself from the static callback list. More...
 
virtual void OnEnable ()
 Unity OnEnable event registers this instance to the static list called by the Quantum callbacks. More...
 

Detailed Description

A legacy way to hook into Quantum game callbacks. Use the publish subscribe pattern used by QuantumCallbacks instead. To use this callback class, derive from it and implement the methods you are interested in. The callback MonoBehaviour has to be added to the scene to work.

Member Function Documentation

◆ OnEnable()

virtual void Quantum.QuantumCallbacks.OnEnable ( )
inlineprotectedvirtual

Unity OnEnable event registers this instance to the static list called by the Quantum callbacks.

◆ OnDisable()

virtual void Quantum.QuantumCallbacks.OnDisable ( )
inlineprotectedvirtual

Unity OnDisable event removes itself from the static callback list.

◆ OnGameInit()

virtual void Quantum.QuantumCallbacks.OnGameInit ( QuantumGame  game,
bool  isResync 
)
inlinevirtual

Is called by CallbackGameInit during QuantumGame.OnGameStart(DeterministicFrame) when the game is about to start.

Parameters
gameThe Quantum game
isResyncIs true when the simulation is paused and waits for snapshot to commence the start.

◆ OnGameStart() [1/2]

virtual void Quantum.QuantumCallbacks.OnGameStart ( QuantumGame  game)
inlinevirtual

Obsolete: use other OnGameStart overload.

Parameters
game

◆ OnGameStart() [2/2]

virtual void Quantum.QuantumCallbacks.OnGameStart ( QuantumGame  game,
bool  isResync 
)
inlinevirtual

Is called by CallbackGameStarted during QuantumGame.OnGameStart or QuantumGame.OnGameResync" when the game is started after systems are initialized and the snapshot has arrived for late-joining clients.

Parameters
gameQuantum game
isResyncIs true if the game was started from a snapshot.

◆ OnGameResync()

virtual void Quantum.QuantumCallbacks.OnGameResync ( QuantumGame  game)
inlinevirtual

Is called by CallbackGameResynced during QuantumGame.OnGameResync when the game has been re-synchronized from a snapshot and is about to start.

Parameters
gameQuantum game

◆ OnGameDestroyed()

virtual void Quantum.QuantumCallbacks.OnGameDestroyed ( QuantumGame  game)
inlinevirtual

Is called by CallbackGameDestroyed when the session has been destroyed."/>

Parameters
gameQuantum game

◆ OnUpdateView()

virtual void Quantum.QuantumCallbacks.OnUpdateView ( QuantumGame  game)
inlinevirtual

Is called by CallbackUpdateView which is originally called by QuantumRunner.Update and it is called every Unity frame.

Parameters
gameQuantum game

◆ OnSimulateFinished()

virtual void Quantum.QuantumCallbacks.OnSimulateFinished ( QuantumGame  game,
Frame  frame 
)
inlinevirtual

Is called by CallbackSimulateFinished after completing the simulation of a frame.

Parameters
gameQuantum game
frameCompleted frame

◆ OnUnitySceneLoadBegin()

virtual void Quantum.QuantumCallbacks.OnUnitySceneLoadBegin ( QuantumGame  game)
inlinevirtual

Is called by CallbackUnitySceneLoadBegin when a Unity scene is about to be loaded. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on.

Parameters
gameQuantum game

◆ OnUnitySceneLoadDone()

virtual void Quantum.QuantumCallbacks.OnUnitySceneLoadDone ( QuantumGame  game)
inlinevirtual

Is called by CallbackUnitySceneLoadDone when a Unity scene has been loaded. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on.

Parameters
gameQuantum game

◆ OnUnitySceneUnloadBegin()

virtual void Quantum.QuantumCallbacks.OnUnitySceneUnloadBegin ( QuantumGame  game)
inlinevirtual

Is called by CallbackUnitySceneUnloadBegin when a Unity scene is about to be unloaded. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on.

Parameters
gameQuantum game

◆ OnUnitySceneUnloadDone()

virtual void Quantum.QuantumCallbacks.OnUnitySceneUnloadDone ( QuantumGame  game)
inlinevirtual

Is called by CallbackUnitySceneUnloadDone when a Unity scene has been unloaded.

Parameters
gameQuantum game

◆ OnChecksumError()

virtual void Quantum.QuantumCallbacks.OnChecksumError ( QuantumGame  game,
DeterministicTickChecksumError  error,
Frame[]  frames 
)
inlinevirtual

Is called by CallbackChecksumError when a checksum error is detected. To enable this feature SimulationConfig.AutoLoadSceneFromMap must be toggled on.

Parameters
gameQuantum game
errorError description
framesList of latest frames

Member Data Documentation

◆ Instances

readonly List<QuantumCallbacks> Quantum.QuantumCallbacks.Instances = new List<QuantumCallbacks>()
static

Static list of all instances of QuantumCallbacks to call on Quantum callbacks. Populated on OnEnable and OnDisable.