private void OnCurrentTargetChanged(VisualTarget oldTarget, VisualTarget newTarget) { if (oldTarget == null && newTarget != null) { StartLooking(); } else if (newTarget == null && oldTarget != null) { StopLooking(); } }
private float CalculateAngleToTarget(VisualTarget target) { return(target != null ? Vector3.Angle(target.transform.position - transform.position, transform.forward) : 0); }
private float CalculateDistanceToTarget(VisualTarget target) { return(target != null ? Vector3.Distance(transform.position, target.transform.position) : 0); }
private float CalculateDistanceToTarget(VisualTarget target) { return (target != null ? Vector3.Distance(transform.position, target.transform.position) : 0); }
private float CalculateAngleToTarget(VisualTarget target) { return (target != null ? Vector3.Angle(target.transform.position - transform.position, transform.forward) : 0); }