using Godot; using GodotStateCharts; namespace Movementtests.godot_state_charts_examples.csharp; /// /// This is an example of how to use the state chart from C#. /// // ReSharper disable once CheckNamespace public partial class CSharpExample : Node2D { private StateChart _stateChart; private Label _feelLabel; private int _health = 20; private StateChartState _poisonedStateChartState; public override void _Ready() { // Get the state chart node and wrap it in a StateChart object, so we can easily // interact with it from C#. _stateChart = StateChart.Of(GetNode("%StateChart")); // Get the poisoned state node and wrap it in a State object, so we can easily // interact with it from C#. _poisonedStateChartState = StateChartState.Of(GetNode("%Poisoned")); // The the UI label. _feelLabel = GetNode