コード例 #1
0
        private void DrawActualFieldOfView(FieldOfView fov)
        {
            var halfAngle      = fov.ViewAngle / 2;
            var viewLeftBound  = fov.GetDirectionFromAngle(-halfAngle, isGlobalAngle: false);
            var viewRightBound = fov.GetDirectionFromAngle(halfAngle, isGlobalAngle: false);

            Handles.color = Color.white;
            var playerPos = fov.transform.position;

            Handles.DrawLine(playerPos, playerPos + viewLeftBound * fov.ViewRadius);
            Handles.DrawLine(playerPos, playerPos + viewRightBound * fov.ViewRadius);
        }
コード例 #2
0
 public FieldOfViewVisual(FieldOfView fov)
 {
     this.fov = fov;
 }
コード例 #3
0
 private void DrawPossibleFieldOfView(FieldOfView fov)
 {
     Handles.color = Color.red;
     Handles.DrawWireArc(fov.transform.position, Vector3.up, fov.transform.forward, 360, fov.ViewRadius);
 }