Interface IInvalidatable
- Namespace
- ElectricDrill.AstraRpgFramework.Contexts
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Interface for objects that act as the origin of downstream state and can notify dependents when they are no longer valid — due to entity death, object pooling, aura deactivation, etc.
OnInvalidated is raised when the object becomes invalid. Subscribers should clean up any state that depends on this object (e.g. modifier instances applied by this source).
Invalidate() can be called explicitly by any system that governs the object's
lifetime (e.g. EntityHealth calls it on entity death; an object pool calls it before
returning an instance to the pool). OnInvalidated is also raised automatically
from OnDestroy on EntityCore as a safety net for GameObject destruction.
public interface IInvalidatable
Methods
Invalidate()
Marks this object as invalid and raises OnInvalidated.
void Invalidate()
Events
OnInvalidated
Raised when this object is invalidated.
event Action OnInvalidated
Event Type
- Action