private void OnCurrentTargetChanged(VisualTarget oldTarget, VisualTarget newTarget)
 {
     if (oldTarget == null && newTarget != null)
     {
         StartLooking();
     }
     else if (newTarget == null && oldTarget != null)
     {
         StopLooking();
     }
 }
Esempio n. 2
0
 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);
 }
Esempio n. 5
0
 private float CalculateDistanceToTarget(VisualTarget target)
 {
     return (target != null ? Vector3.Distance(transform.position, target.transform.position) : 0);
 }
Esempio n. 6
0
 private float CalculateAngleToTarget(VisualTarget target)
 {
     return (target != null ? Vector3.Angle(target.transform.position - transform.position, transform.forward) : 0);
 }