Skip to content

Component.OnEnabled() Method

Definition

Namespace: Brine2D.ECS

Called when this component transitions from disabled to enabled \(i\.e\., [IsEnabled](IsEnabled.md 'Brine2D\.ECS\.Component\.IsEnabled') changes to [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs\.microsoft\.com/en\-us/dotnet/csharp/language\-reference/builtin\-types/bool')\). Also called when the owning entity transitions from inactive to active \([IsActive](../Entity/IsActive.md 'Brine2D\.ECS\.Entity\.IsActive') changes to [true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs\.microsoft\.com/en\-us/dotnet/csharp/language\-reference/builtin\-types/bool')\) and this component's IsEnabled is already true. Override to resume state or restart effects.

C#
protected internal virtual void OnEnabled();