Photon Quantum 3.0.0

List of all members
Quantum.QuantumCallback Class Reference

Quantum callbacks are special types of events that are triggered internally by the Quantum simulation. For example CallbackUpdateView for Unity updates, CallbackPollInput that polls for player input. Use this class to subscribe and unsubscribe from Quantum callbacks. More...

Inheritance diagram for Quantum.QuantumCallback:
Quantum.QuantumUnityStaticDispatcherAdapter< QuantumUnityCallbackDispatcher, CallbackBase >

Additional Inherited Members

- Static Public Member Functions inherited from Quantum.QuantumUnityStaticDispatcherAdapter< QuantumUnityCallbackDispatcher, CallbackBase >
static void Clear ()
 Removes all listeners and destroys the worker object. More...
 
static void RemoveDeadListeners ()
 Removes dead listeners from the dispatcher. More...
 
static DispatcherSubscription Subscribe< TDispatchable > (Object listener, DispatchableHandler< TDispatchable > handler, DeterministicGameMode gameMode, bool exclude=false, bool once=false, bool onlyIfActiveAndEnabled=false, bool onlyIfEntityViewBound=false)
 Creates a subscription. The subscription lifetime is tied to the listener object, unless explicitly unsubscribed. More...
 
static DispatcherSubscription Subscribe< TDispatchable > (Object listener, DispatchableHandler< TDispatchable > handler, DeterministicGameMode[] gameModes, bool exclude=false, bool once=false, bool onlyIfActiveAndEnabled=false, bool onlyIfEntityViewBound=false)
 Creates a subscription. The subscription lifetime is tied to the listener object, unless explicitly unsubscribed. More...
 
static DispatcherSubscription Subscribe< TDispatchable > (Object listener, DispatchableHandler< TDispatchable > handler, DispatchableFilter filter=null, bool once=false, bool onlyIfActiveAndEnabled=false, bool onlyIfEntityViewBound=false)
 Creates a subscription. The subscription lifetime is tied to the listener object, unless explicitly unsubscribed. More...
 
static DispatcherSubscription Subscribe< TDispatchable > (Object listener, DispatchableHandler< TDispatchable > handler, QuantumGame game, bool once=false, bool onlyIfActiveAndEnabled=false, bool onlyIfEntityViewBound=false)
 Creates a subscription. The subscription lifetime is tied to the listener object, unless explicitly unsubscribed. More...
 
static DispatcherSubscription Subscribe< TDispatchable > (Object listener, DispatchableHandler< TDispatchable > handler, QuantumRunner runner, bool once=false, bool onlyIfActiveAndEnabled=false, bool onlyIfEntityViewBound=false)
 Creates a subscription. The subscription lifetime is tied to the listener object, unless explicitly unsubscribed. More...
 
static DispatcherSubscription Subscribe< TDispatchable > (Object listener, DispatchableHandler< TDispatchable > handler, string runnerId, bool once=false, bool onlyIfActiveAndEnabled=false, bool onlyIfEntityViewBound=false)
 Creates a subscription. The subscription lifetime is tied to the listener object, unless explicitly unsubscribed. More...
 
static IDisposable SubscribeManual< TDispatchable > (DispatchableHandler< TDispatchable > handler, DispatchableFilter filter=null, bool once=false)
 
static IDisposable SubscribeManual< TDispatchable > (DispatchableHandler< TDispatchable > handler, IDeterministicGame game, bool once=false)
 
static IDisposable SubscribeManual< TDispatchable > (object listener, DispatchableHandler< TDispatchable > handler, DispatchableFilter filter=null, bool once=false)
 
static bool Unsubscribe (DispatcherSubscription subscription)
 
static bool Unsubscribe (ref DispatcherSubscription subscription)
 
static bool UnsubscribeListener (object listener)
 
static bool UnsubscribeListener< TDispatchable > (object listener)
 
- Properties inherited from Quantum.QuantumUnityStaticDispatcherAdapter< QuantumUnityCallbackDispatcher, CallbackBase >
static TDispatcher Dispatcher [get]
 The dispatcher instance. More...
 

Detailed Description

Quantum callbacks are special types of events that are triggered internally by the Quantum simulation. For example CallbackUpdateView for Unity updates, CallbackPollInput that polls for player input. Use this class to subscribe and unsubscribe from Quantum callbacks.

// Use this signature when subscribing from a MonoBehaviour, the subscription will be automatically removed when the MonoBehaviour is destroyed.
QuantumCallback.Subscribe(this, (CallbackUpdateView c) => { Log.Debug(c.Game.Frames.Verified.Number); });
// Use this signature when manually disposing the subscription.
var subscription = QuantumCallback.SubscribeManual((CallbackUpdateView c) => { Log.Debug(c.Game.Frames.Verified.Number); });
subscription.Dispose();