The base class to inherit entity view components from. Entity view components can be used to add features to entity views and gain simple access to all relevant Quantum game API and the Quantum entity. More...
Public Member Functions | |
TComponent | GetPredictedQuantumComponent< TComponent > () |
Returns the desired Quantum component from the entity of the the predicted frame. This method throws exceptions when the Frame or Entity ref are not assigned, as well as when the Quantum entity does not have the component. Core.FrameBase.Get<T>(EntityRef) More... | |
TComponent | GetVerifiedQuantumComponent< TComponent > () |
Returns the desired Quantum component from the entity of the the verified frame. This method throws exceptions when the Frame or Entity ref are not assigned, as well as when the Quantum entity does not have the component. Core.FrameBase.Get<T>(EntityRef) More... | |
bool | HasPredictedQuantumComponent< TComponent > () |
Checks the predicted frame if this Quantum entity has a particular Quantum entity. More... | |
bool | HasVerifiedQuantumComponent< TComponent > () |
Checks the verified frame if this Quantum entity has a particular Quantum entity. More... | |
bool | TryGetPredictedQuantumComponent< TComponent > (out TComponent value) |
Try to get the component from this Quantum entity and the predicted frame. Core.FrameBase.TryGet<T>(EntityRef, out T) More... | |
bool | TryGetVerifiedQuantumComponent< TComponent > (out TComponent value) |
Try to get the component from this Quantum entity and the verified frame. Core.FrameBase.TryGet<T>(EntityRef, out T) 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 | |
EntityRef | EntityRef => _entityView.EntityRef |
The Quantum EntityRef that the underlying entity view is attached to. More... | |
QuantumEntityView | EntityView => _entityView |
A reference to the parent class to access interesting game and entity data. More... | |
override QuantumGame | Game => _entityView?.Game |
The Game that the entity belongs to. This can change after the OnGameChanged() callback. Set before calling OnActivate(Frame). 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... | |
T | 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... | |
The base class to inherit entity view components from. Entity view components can be used to add features to entity views and gain simple access to all relevant Quantum game API and the Quantum entity.
A entity view component without context type.
T | The type of the custom view context used by this view component. Can be IQuantumEntityViewContext if not required. |
T | : | IQuantumViewContext |
bool Quantum.QuantumEntityViewComponent< T >.HasPredictedQuantumComponent< TComponent > | ( | ) |
Checks the predicted frame if this Quantum entity has a particular Quantum entity.
TComponent | Quantum component type |
TComponent | : | unmanaged | |
TComponent | : | IComponent | |
TComponent | : | PredictedFrame | |
TComponent | : | null | |
TComponent | : | EntityView | |
TComponent | : | null | |
TComponent | : | false | |
TComponent | : | PredictedFrame.Has<TComponent> | |
TComponent | : | EntityRef |
bool Quantum.QuantumEntityViewComponent< T >.HasVerifiedQuantumComponent< TComponent > | ( | ) |
Checks the verified frame if this Quantum entity has a particular Quantum entity.
TComponent | Quantum component type |
TComponent | : | unmanaged | |
TComponent | : | IComponent | |
TComponent | : | VerifiedFrame | |
TComponent | : | null | |
TComponent | : | EntityView | |
TComponent | : | null | |
TComponent | : | false | |
TComponent | : | VerifiedFrame.Has<TComponent> | |
TComponent | : | EntityRef |
TComponent Quantum.QuantumEntityViewComponent< T >.GetPredictedQuantumComponent< TComponent > | ( | ) |
Returns the desired Quantum component from the entity of the the predicted frame. This method throws exceptions when the Frame or Entity ref are not assigned, as well as when the Quantum entity does not have the component. Core.FrameBase.Get<T>(EntityRef)
TComponent | Quantum component type |
TComponent | : | unmanaged | |
TComponent | : | IComponent | |
TComponent | : | PredictedFrame.Get<TComponent> | |
TComponent | : | EntityRef |
TComponent Quantum.QuantumEntityViewComponent< T >.GetVerifiedQuantumComponent< TComponent > | ( | ) |
Returns the desired Quantum component from the entity of the the verified frame. This method throws exceptions when the Frame or Entity ref are not assigned, as well as when the Quantum entity does not have the component. Core.FrameBase.Get<T>(EntityRef)
TComponent | Quantum component type |
TComponent | : | unmanaged | |
TComponent | : | IComponent | |
TComponent | : | VerifiedFrame.Get<TComponent> | |
TComponent | : | EntityRef |
|
inline |
Try to get the component from this Quantum entity and the predicted frame. Core.FrameBase.TryGet<T>(EntityRef, out T)
TComponent | Desired component type |
value | The resulting Quantum component instance. |
TComponent | : | unmanaged | |
TComponent | : | IComponent |
|
inline |
Try to get the component from this Quantum entity and the verified frame. Core.FrameBase.TryGet<T>(EntityRef, out T)
TComponent | Desired component type |
value | The resulting Quantum component instance. |
TComponent | : | unmanaged | |
TComponent | : | IComponent |
override QuantumGame Quantum.QuantumEntityViewComponent< T >.Game => _entityView?.Game |
The Game that the entity belongs to. This can change after the OnGameChanged() callback. Set before calling OnActivate(Frame).
EntityRef Quantum.QuantumEntityViewComponent< T >.EntityRef => _entityView.EntityRef |
The Quantum EntityRef that the underlying entity view is attached to.
QuantumEntityView Quantum.QuantumEntityViewComponent< T >.EntityView => _entityView |
A reference to the parent class to access interesting game and entity data.