Exemplo n.º 1
0
        // TBD: make some stages optional
        void Refresh()
        {
            var targets = trackColliders.Refresh();

            if (applyAngleFilter)
            {
                targets = filterByAngle.Input(targets);
            }
            if (applyLineOfSightFilter)
            {
                targets = lineOfSight.Input(targets);
            }
            targets = targetFilter.Input(targets);
            var target = VectorMath.GetClosest(targets, transform.position);

            ClosestTarget.Invoke(target);
            //Debug.Log($"Nearby: {nearby.Count}, in view: {inView.Count}, in sight: {inSight.Count}, " +
            //          $"targets: {visibleTargets.Count}, closest: {closestTarget}");
        }