Unity-Technologies / Unity-Technologies/Unity.Mathematics
Add deconstructors for vector types
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
It would be nice if the vector types had built-in deconstructors. So that we could write
var (x, y, z) = properlyNamedVectorVariable;
instead of verbose and error-prone
var x = properlyNamedVectorVariable.x;
var y = properlyNamedVectorVariable.y;
var z = properlyNamedVectorVariable.z;
or
var (x, y, z) = (properlyNamedVectorVariable.x, properlyNamedVectorVariable.y, properlyNamedVectorVariable.z);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the vector type definitions in the C# library and reviewing how their x, y, and z components are exposed. Check all relevant vector dimensions and existing tests or usage examples; done means the supported vector types can be assigned with C# deconstruction syntax without the repeated component-access code shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100