// overrides the current target without scanning public void OverrideCurrentTarget(Unit newTarget) { CurrentTarget = newTarget; if (!_detectedTargets.TryGetValue(newTarget, out DetectedTarget entry)) { _detectedTargets.Add(newTarget, new DetectedTarget() { Target = newTarget, DetectedThisFrame = true, DetectionValue = MaxDetection }); } CurrentDetectable = _detectedTargets[newTarget]; HighestDetectedTarget = null; _detectedTargets.Clear(); OnCurrentTargetSet?.Invoke(newTarget); }
public void ClearCurrentTarget() { CurrentTarget = null; CurrentDetectable = null; OnCurrentTargetSet?.Invoke(null); }