Generates physics metric units, and performs compile time dimensional analysis
Now you don't need to worry about messing up your physics equations
How it works:
you configure the generator and it generates all the units and operations with dimensional analysis already done.
public static N operator /(W power, mps speed) => new N(power.f / speed.f);
Don't worry all the conversions happen in editor.
You can configure whatewer units you want in your editor.
Supports All the physics units: s, kg, m, A, K, mol, cd;
Bonus unit: rad for more efficien conversion from deg to rad in editor.
- Create UnitGenerator ScriptableObject in a directory where you want to generate the units code.
- Alternatively you can Copy Packages/com.ovpavlov.unitgenerator/Editor/UnitGeneratorExample.asset for preconfigured generator example
- Toggle 'Dry Run' and then press 'Generate Button'(which in fact is a Button that looks like a toggle), and check Console to see diagnostics.
- Untoggle 'Dry Run' and then press 'Generate Button' to generate the code