Untitled

mail@pastecode.io avatar
unknown
csharp
a year ago
237 B
1
Indexable
Never
    public void ChangeState(string stateName)
    {
        if (currentState != null)
        {
            currentState.Exit();
        }

        currentState = stateDictionary[stateName];
        currentState.Enter();
    }