How aniketrajnish/unity-collider-optimizer works
Project type and purpose
• This is a Unity Editor package/plugin (“Unity Collider Optimizer”) that adds context-menu and Tools-window commands to simplify 2D and 3D colliders. It lives entirely in the Unity Editor, uses Editor scripts (C#), ScriptableObject presets, and bundles native gltfpack binaries for mesh simplification.
File structure
• Top‐level:
• Assets/ColliderOptimizer – all plugin code and demo scenes
– Editor/1-core – core domain logic for Mesh & Polygon operations
– Editor/2-utils – helper libraries (RDP, ObjExporter, Math helpers)
– Editor/3-ui – UI layer (context menus, EditorWindow)
– Editor/4-gltfpack – native binaries + runner and bootstrapper code
– Assets/ColliderOptimizer/Assets – sample materials, sprites, meshes
– Assets/ColliderOptimizer/Scenes – example Unity scenes
• Packages – Unity package manifest, lockfile (declares dependency on GLTF importer)
• ProjectSettings/ColliderOptimizerSettings.asset – stores default params
Extract architecture insights from README
• Two main flows:
a. MeshCollider optimization (calls gltfpack external process + re-import)
b. PolygonCollider2D optimization (in-process RDP line simplification)
• Presets are either ScriptableObjects under “Assets → Create → ColliderOptimizer” or stored in ProjectSettings.
• Depends on a GLTF importer plugin (glTFast or UnityGLTF) for re-importing simplified meshes.
Detail
• Both Mesh and Polygon flows side by side
• Where presets live and how settings propagate
• Don’t forget the GLTF importer plugin dependency and its role in mesh re-import
• Sample Scenes as an “Examples” artifact, not part of the core runtime