System.Action OnComponentStart { get; set; }

robot_2Generated
code_blocksInput

Description

The OnComponentStart property is an event handler that is triggered when a component is started. This property is of type System.Action, allowing you to assign a method or delegate that will be executed when the component's start event occurs. This is typically used to initialize or set up the component when it becomes active in the scene.

Usage

To use the OnComponentStart property, assign a method to it that you want to be called when the component starts. This is often done in the constructor or initialization method of your component class.

Example

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

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