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.
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.
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.
public class MyComponent : Component { public MyComponent() { OnComponentStart = Initialize; } private void Initialize() { // Initialization code here // This code will run when the component starts } }