< Back to main page
3D-Enemy-Detector
Fastest/Lightweight implementation for detecting the closest enemies in a 3D space, using a data structure called K-Dimensional Tree (also known as K-D Tree) Tech Stack: Unity, C#, AssetBundles, ScriptableObjects, Service Locator Pattern Platforms: PC, iOS, Android 2026 Github: https://github.com/igorhosantos/3D-Enemy-Detection


Main Implementations
| KdTree Logic: Implementation for the logic of controlling the logical data and calculating the nearest nodes. It also supports the logic for 2D only |
| Object Pooling: Reusing Objects that already exist when they need to create new instances during runtime. For this particular object, we're using this approach for the 3D players spawned and for the UI items during hitting scam. |
| Observable: Design pattern approach for setting listeners and updating the view every time a new player spawned, and when a player has a new update (e.g hitting scam) |
| Clean Architecture (Controller, Data, Presenters): The layers of this project are separated by following the clean architecture project pattern: Data/Mode: (PlayerMovement is a scriptable object to manage parameters for each player instance). Controller: Each Game entity has the logic separately on its own Controller (e.g., Hud, Player). Presenters/View: Player has a view layer for updating all the visual changes (e.g Position) |
