Skip to content

Commit d52af78

Browse files
authored
Update README.md
1 parent e87d97d commit d52af78

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,77 @@
1+
# 🧠 Vision Field System for Unity
12

3+
## 🔍 Overview
4+
5+
**VisionFieldSystem** — модульная и гибкая система обзора (FOV) для Unity, включающая визуализацию зоны видимости и обнаружение целей с учётом препятствий. Поддерживает разные формы обзора и настраивается через инспектор.
6+
7+
Подходит для врагов, турелей, NPC, охранников и любых AI-систем восприятия.
8+
9+
10+
## 📽️ Demo Preview
11+
12+
| Type | Mesh + Detector Pair | Preview |
13+
|------------------|--------------------------------------------------------|--------------------------------------------------------|
14+
| **Circle** | `VisionFieldMesh` + `TargetFieldDetector` | ![](https://github.com/user-attachments/assets/c0864105-69f8-498b-9de5-39c403db2e54) |
15+
| **Arrow** | `VisionArrowMesh` + `TargetArrowDetector` | ![](https://github.com/user-attachments/assets/3f6d499e-c2e4-4b62-b511-3e272ae8206d) |
16+
| **Half Ellipse** | `VisionHalfEllipseMesh` + `TargetHalfEllipseDetector` | ![](https://github.com/user-attachments/assets/8ce44c5d-a9ee-48d7-9dfa-58d729b61d30) |
17+
| **Triangle** | `VisionOffsetTriangleMesh` + `TargetOffsetTriangleDetector` | ![](https://github.com/user-attachments/assets/891876e5-8b9b-4720-b407-1e030d66192f) |
18+
| **Square** | `VisionSquareMesh` + `TargetSquareDetector` | ![](https://github.com/user-attachments/assets/5a57c130-37a7-4c5e-9add-12e90ee40af6) |
19+
| **Rhombus** | `VisionRhombusMesh` + `TargetRhombusDetector` | ![](https://github.com/user-attachments/assets/e03875ed-f6a6-4724-a7a3-da4cb4524cde) |
20+
21+
![image](https://github.com/user-attachments/assets/4acb0538-51d5-40d1-9329-589ddc005b30)
22+
23+
https://github.com/user-attachments/assets/c0864105-69f8-498b-9de5-39c403db2e54
24+
25+
https://github.com/user-attachments/assets/3f6d499e-c2e4-4b62-b511-3e272ae8206d
26+
27+
https://github.com/user-attachments/assets/8ce44c5d-a9ee-48d7-9dfa-58d729b61d30
28+
29+
## ⚙️ Features
30+
31+
- 🧩 Visual FOV using procedural mesh
32+
- 🎯 Raycast-based target detection with obstacle mask
33+
- 🧪 Debug Gizmos for ray tracing and hit visualization
34+
- 🛠️ Fully customizable parameters (width, height, segments, tilt, offset)
35+
- 🎥 Runtime detection events: `OnTargetDetected`, `OnTargetLost`
36+
- 🌗 `RaycastOffset` to avoid surface clipping
37+
- ♻️ Clean modular architecture: easy to extend
38+
39+
---
40+
41+
## 🧰 How to Use
42+
43+
1. Add a **Vision Mesh** component (e.g. `VisionFieldMesh`) to a GameObject.
44+
2. Attach the corresponding **Target Detector** (e.g. `TargetFieldDetector`).
45+
3. Set required masks and dimensions in the inspector.
46+
4. Enable **Is Show Debug** to see rays and hit points in the Scene.
47+
5. Subscribe to target events:
48+
49+
```csharp
50+
_detector.OnTargetDetected += enemy => Debug.Log($"🎯 Seen: {enemy.name}");
51+
_detector.OnTargetLost += enemy => Debug.Log($"👀 Lost: {enemy.name}");
52+
🗂️ Project Structure
53+
bash
54+
Копировать
55+
Редактировать
56+
Assets/
57+
└── Code/
58+
├── Cameras/
59+
├── Editors/
60+
├── Enemies/
61+
├── Infrastructure/
62+
├── Levels/
63+
├── Players/
64+
├── UI/
65+
├── Utilities/
66+
├── Weapon/
67+
└── VisionCone/
68+
├── Detectors/
69+
├── Factory/
70+
├── Provider/
71+
└── Visions/
72+
```
73+
74+
✅ Requirements
75+
Unity 2021.3+
76+
URP or Built-in RP
77+
DOTween (optional, for demo animations)

0 commit comments

Comments
 (0)