private void OnPauseStatusChanged(PauseStatusChangedMessage inMessage) { if (inMessage.NewPauseStatus == EPauseStatus.Paused) { _actionStateMachine.RequestActionState(EActionStateMachineTrack.UI, EActionStateId.OpenMenuUI, new ActionStateInfo(gameObject)); } else { _actionStateMachine.RequestActionState(EActionStateMachineTrack.UI, EActionStateId.Null, new ActionStateInfo(gameObject)); } }
private void InitialiseAI() { if (_healthInterface != null) { _healthInterface.ReplenishHealth(); } if (_actionStateMachine != null) { _actionStateMachine.RequestActionState(EActionStateMachineTrack.Locomotion, EActionStateId.Null, new ActionStateInfo(gameObject)); } }
private void OnHealthSet(int newHealth, GameObject healthAdjuster = null) { if (CanAdjustHealth()) { var healthChange = newHealth - _currentHealth; _currentHealth = newHealth; _currentHealth = Mathf.Clamp(_currentHealth, 0, GetMaxHealth()); UnityMessageEventFunctions.InvokeMessageEventWithDispatcher(gameObject, new HealthChangedMessage(healthChange, _currentHealth, healthAdjuster)); if (_currentHealth <= 0) { _stateMachine.RequestActionState(EActionStateMachineTrack.Locomotion, EActionStateId.Dead, new ActionStateInfo(gameObject)); } } }