Example #1
0
 // Draw the line of sight representation within the scene window
 void OnDrawGizmos()
 {
     if (this.gameObject != null)
     {
         CanSeeObject.DrawLineOfSight(transform, offset, fieldOfViewAngle, viewDistance, usePhysics2D);
     }
 }
        GameObject CanSeeEnemy(CanSeeObject canSeeObject, bool _Team1)
        {
            if (!canSeeObject.CanSee())
            {
                return(null);
            }
            PlayerController pC = canSeeObject.CanSee().GetComponent <PlayerController>();

            if (pC != null)
            {
                if (pC.Team1 != _Team1)
                {
                    return(pC.gameObject);
                }
            }
            else
            {
                AIPlayer aIP = canSeeObject.CanSee().GetComponent <AIPlayer>();
                if (aIP == null)
                {
                    return(null);
                }

                if (aIP.Team1 != _Team1)
                {
                    return(aIP.gameObject);
                }
            }
            return(null);
        }