// attempt to enter this state public virtual void Enter() { // CustomLogger.Log(this.name, $"Entering game state {StateId}"); IsLoading = true; // enter parent state first, if necessary if (ParentState != null && !ParentState.IsActive) { ParentState.OnGameStateEnter += OnParentStateEntered; ParentState.Enter(); return; } OnReadyToEnter(); }
// enter state behaviour public virtual void Enter(AIStateInitializationData initData = null) { // if has parent and parent is not active, enter parent state if (_active) { return; } if (ParentState != null) { ParentState.OnReadyToTransitionState += SetReadyToTransition; ParentState.Enter(initData); } OnEnter(); }