protected virtual void OnStateEnterComplete() { if (ParentState != null) { ParentState.OnGameStateEnter -= OnStateEnterSuccess; } OnGameStateEnter?.Invoke(); }
// delegate watchers public void AddOnGameStateEnter(OnGameStateEnter func) { gameStateEnterWatchers += func; }
public void RemoveOnGameStateEnter(OnGameStateEnter func) { gameStateEnterWatchers -= func; }
private void OnDisable() { SetCurrentGameState(GameState.Disabled); gameStateEnterWatchers = null; gameStateExitWatchers = null; }