Пример #1
0
        protected void Start()
        {
            _healthChangeEnabled = new TieredLock <EHealthLockReason>();

            _stateMachine = gameObject.GetComponent <IActionStateMachineInterface>();
            MaxHealth     = InitialHealth;
            ReplenishHealth();
        }
Пример #2
0
        protected void Start()
        {
            DeathMessage        = new LocalisedTextRef(new LocalisationKey("UIMessages", "DeathMessage"));
            SavedMessage        = new LocalisedTextRef(new LocalisationKey("UIMessages", "SaveMessage"));
            _actionStateMachine = gameObject.GetComponent <IActionStateMachineInterface>();

            _localDispatcher = gameObject.GetComponent <IUnityMessageEventInterface>().GetUnityMessageEventDispatcher();
            _uiDispatcher    = GameInstance.CurrentInstance.GetUIMessageDispatcher();

            RegisterForMessages();
        }
Пример #3
0
        public AttackTargetGoal(GameObject inOwner, GameObject inTarget)
            : base(inOwner)
        {
            _target = inTarget;
            if (inOwner != null)
            {
                _attack = inOwner.GetComponent <IAttackInterface>();
            }

            if (inTarget != null)
            {
                _targetState = inTarget.GetComponent <IActionStateMachineInterface>();
            }
        }
Пример #4
0
 private void GetRefreshables()
 {
     _healthInterface    = gameObject.GetComponent <IHealthInterface>();
     _actionStateMachine = gameObject.GetComponent <IActionStateMachineInterface>();
 }
Пример #5
0
 private bool InLocomotion(IActionStateMachineInterface inActionStateMachineInterface)
 {
     return(inActionStateMachineInterface != null &&
            inActionStateMachineInterface.IsActionStateActiveOnTrack(EActionStateMachineTrack.Locomotion,
                                                                     EActionStateId.Locomotion));
 }