Photon Quantum 3.0.0

Public Member Functions | Public Attributes | List of all members
Quantum.QuantumSceneViewComponent< T > Class Template Reference

The SceneViewComponent is able to attach itself to the QuantumEntityViewUpdater and received updates from it. More...

Inheritance diagram for Quantum.QuantumSceneViewComponent< T >:
Quantum.QuantumViewComponent< T > Quantum.QuantumMonoBehaviour Quantum.IQuantumViewComponent

Public Member Functions

virtual void OnDisable ()
 Unity OnDisabled, will try to detach the script from the Updater. More...
 
virtual void OnEnable ()
 Unity OnEnabled, will try to attach this script to the Updater. More...
 
- Public Member Functions inherited from Quantum.QuantumViewComponent< T >
void Activate (Frame frame, QuantumGame game, QuantumEntityView entityView)
 Is only called internally. Sets the entity view parent. More...
 
void Deactivate ()
 Is only called internally. More...
 
void GameChanged (QuantumGame game)
 Is only called internally. More...
 
void Initialize (Dictionary< Type, IQuantumViewContext > contexts)
 Is only called internally. Sets the view context of this entity view component. More...
 
void LateUpdateView ()
 Is only called internally. More...
 
virtual void OnActivate (Frame frame)
 Is called when the entity view is activated and the entity was created. More...
 
virtual void OnDeactivate ()
 Is called when the view component is deactivated. More...
 
virtual void OnGameChanged ()
 Is called from the QuantumEntityViewUpdater then the observed game is changed. More...
 
virtual void OnInitialize ()
 Is called when the entity view is enabled for the first time. The ViewContext is already set if available. Access to Game, VerifiedFrame, PredictedFrame and PredictedPreviousFrame is not available yet. More...
 
virtual void OnLateUpdateView ()
 Is called from the QuantumEntityViewUpdater on a Unity late update. More...
 
virtual void OnUpdateView ()
 Is called from the QuantumEntityViewUpdater on a Unity update. More...
 
void UpdateView ()
 Is only called internally. More...
 

Public Attributes

QuantumEntityViewUpdater Updater
 Will attach this view component to this EntityViewUpdater so it receives update callbacks from there. This field will not be set unless set explicitly or UseFindUpdater is true. More...
 
bool UseFindUpdater
 Uses UnityEngine.Object.FindObjectOfType/FindObjectByType to find the Updater. This is very slow and not recommended. More...
 
- Public Attributes inherited from Quantum.QuantumViewComponent< T >
virtual QuantumGame Game => _game
 The Game that the entity belongs to. This can change after the OnGameChanged() callback. Set before calling OnActivate(Frame). More...
 
bool IsActiveAndEnabled => IsActive && enabled && gameObject != null && gameObject.activeInHierarchy
 Returns true if the view component is IsActive and Behaviour.enabled. More...
 
Frame PredictedFrame => Game?.Frames.Predicted
 The newest predicted frame. Set before calling OnActivate(Frame). More...
 
Frame PredictedPreviousFrame => Game?.Frames.PredictedPrevious
 The newest predicted previous frame. Set before calling OnActivate(Frame). More...
 
Frame VerifiedFrame => Game?.Frames.Verified
 The newest verified frame. Set before calling OnActivate(Frame). More...
 

Additional Inherited Members

- Protected Attributes inherited from Quantum.QuantumViewComponent< T >
QuantumEntityView _entityView
 Cached entity view is updated during Activate. More...
 
QuantumGame _game
 Cached game object is updated during Activate and GameChanged. More...
 
- Properties inherited from Quantum.QuantumViewComponent< T >
bool IsActive [get]
 Is the view component currently activated and not inside the pool. More...
 
bool IsInitialized [get]
 Returns true if the view component has been initialized. More...
 
ViewContext [get]
 The view context of the QuantumEntityViewUpdater associated with this entity view component. More...
 
- Properties inherited from Quantum.IQuantumViewComponent
bool IsActive [get]
 Is toggled during Activate and Deactivate."/> More...
 
bool IsActiveAndEnabled [get]
 Returns IsActive More...
 
bool IsInitialized [get]
 The initialized state has to kept track of by the view component to not call it multiple times. More...
 

Detailed Description

The SceneViewComponent is able to attach itself to the QuantumEntityViewUpdater and received updates from it.

A Quantum scene view component without context. The SceneViewComponent is able to attach itself to the QuantumEntityViewUpdater and received updates from it.

Set Updater explicitly, or set UseFindUpdater or make this script a child of QuantumEntityViewUpdater.

Template Parameters
T
Type Constraints
T :IQuantumViewContext 

Member Function Documentation

◆ OnEnable()

virtual void Quantum.QuantumSceneViewComponent< T >.OnEnable ( )
inlinevirtual

Unity OnEnabled, will try to attach this script to the Updater.

◆ OnDisable()

virtual void Quantum.QuantumSceneViewComponent< T >.OnDisable ( )
inlinevirtual

Unity OnDisabled, will try to detach the script from the Updater.

Member Data Documentation

◆ Updater

Will attach this view component to this EntityViewUpdater so it receives update callbacks from there. This field will not be set unless set explicitly or UseFindUpdater is true.

◆ UseFindUpdater

bool Quantum.QuantumSceneViewComponent< T >.UseFindUpdater

Uses UnityEngine.Object.FindObjectOfType/FindObjectByType to find the Updater. This is very slow and not recommended.