// 2026년 포트폴리오용 재구성 코드. 실제 업무 당시 소스가 아닙니다. // 2026 portfolio reconstruction. Not original production source. using UnityEngine; namespace PortfolioExamples { public enum Awareness { Patrol, Investigate, Engage } public static class PerceptionRules { // Occlusion is supplied by a caller's raycast. This function does not perform physics queries. public static bool InView(Vector3 eye, Vector3 forward, Vector3 target, float range, float fov, bool occluded) { Vector3 delta = target - eye; if (occluded || range < 0 || delta.sqrMagnitude > range * range || forward.sqrMagnitude < 0.0001f) return false; return delta.sqrMagnitude < 0.0001f || Vector3.Angle(forward, delta) <= Mathf.Clamp(fov, 0, 360) * 0.5f; } public static Awareness Decide(bool seesTarget, bool heardAlly, float secondsSinceLastSignal, float memorySeconds) { if (seesTarget) return Awareness.Engage; if (heardAlly || secondsSinceLastSignal < Mathf.Max(0, memorySeconds)) return Awareness.Investigate; return Awareness.Patrol; } } }