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