Contributing
Guidelines
- All methods belong in the
Unity.Mathematics.mathx partial class (single using static).
- Use lower-case, shader-like method names; keep names short but meaningful.
- Everything must be open source; credit original authors in file headers or above snippets.
- File names:
mathx.<usage>.<differentiation> (e.g. mathx.interpolation.common).
- Base types (
bounds, byte2, …) use the type name only: bounds.cs, byte2.cs.
- Methods should be
static where applicable.
- Avoid extra dependencies — prefer Unity.Mathematics /
math when an equivalent exists.
- For direct
math translations, inherit XML docs with <inheritdoc cref="…"/>.
Tests
- Add or update Unity Test Framework tests in
Tests/ for behavior changes.
- Prefer golden-value tests for deterministic APIs (hashing, noise); tolerance tests for fast math.
- Run Window → General → Test Runner → Edit Mode before opening a PR.
- See Quality for local setup and IL2CPP checklist.
Documentation
- Add
/// comments on new public APIs (see existing files under Runtime/).
- Update guides under
docs~/guides/ when adding major feature areas.
- API pages are generated by DocFX on push to
master — XML comments become the reference.