System.Action OnComponentUpdate { get; set; }

robot_2Generated
code_blocksInput

Description

The OnComponentUpdate property is an event handler that is invoked during the update cycle of a component. This property allows you to assign a method that will be called every frame, enabling you to perform operations that need to be updated regularly, such as checking for input or updating animations.

Usage

To use the OnComponentUpdate property, assign a method to it that you want to be executed during the component's update cycle. This method should have no parameters and return void. It is typically used to handle logic that needs to be checked or updated every frame.

Example

public class MyComponent : Component
{
    public MyComponent()
    {
        OnComponentUpdate = UpdateLogic;
    }

    private void UpdateLogic()
    {
        // Your update logic here
        // For example, move the GameObject or check for input
    }
}