void StateHasChanged()

book_4_sparkGenerated
code_blocksInput

Description

The StateHasChanged method is a member of the GameResource class in the Sandbox API. This method should be called whenever a resource has been modified through the inspector. It ensures that any changes made to the resource are recognized and processed appropriately by the system.

Usage

Invoke the StateHasChanged method after making any modifications to a GameResource object via the inspector. This is crucial for maintaining the integrity of the resource's state and ensuring that any unsaved changes are tracked.

Example

// Example of using StateHasChanged in a custom GameResource
public class MyCustomResource : GameResource
{
    public void ModifyResource()
    {
        // Modify the resource properties here

        // Notify the system that the state has changed
        StateHasChanged();
    }
}