System.Action OnComponentStart { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The OnComponentStart property is an event handler that is triggered when a component starts. This is typically used to initialize the component or perform any setup required when the component becomes active in the scene.

Usage

Assign a method to the OnComponentStart property to define what should happen when the component starts. This method should match the System.Action delegate signature, meaning it should be a parameterless method.

Example

public class MyComponent : Component
{
    public MyComponent()
    {
        OnComponentStart = Initialize;
    }

    private void Initialize()
    {
        // Initialization code here
        // This code will run when the component starts
    }
}