private void HandleActionTargetAssignment(Transform target, Transform assignTo)
 {
     if (assignTo == _transform)
     {
         _autoActionController.AssignTarget(target);
     }
 }
Example #2
0
 private void HandleTargetAssignmentResponse(Transform originator, Transform target)
 {
     if (originator == _transform)
     {
         _autoActionController.AssignTarget(target);
     }
 }
Example #3
0
        private void UpdateThreat(Transform threatSource, float threatValue)
        {
            Debug.Log(string.Format("{0} detected THREAT from {1} (value {2})", _transform.name, threatSource.name, threatValue));

            if (!_threatValues.ContainsKey(threatSource))
            {
                _threatValues.Add(threatSource, threatValue);
            }
            else
            {
                _threatValues[threatSource] += threatValue;
            }

            Transform greatestThreat = GetGreatestThreat();

            if (greatestThreat != _currentTarget)
            {
                _currentTarget = greatestThreat;
                _autoActionController.AssignTarget(greatestThreat);

                Debug.Log(string.Format("{0} switched target to greatest threat {1}", _transform.name, _currentTarget.name));
            }
        }