StansAssets / com.stansassets.foundation

Collection of utility methods, design patterns, and extensions for Unity.
https://stansassets.com/
MIT License
129 stars 12 forks source link

Vector3Extensions/Vector2Extensions kinda CodeReview #100

Open soraphis opened 2 years ago

soraphis commented 2 years ago

https://github.com/StansAssets/com.stansassets.foundation/blob/master/Runtime/Extensions/UnityEngine/Vector3Extensions.cs#L16-L22

this is the same as: return (b - a).sqrMagnitude (https://docs.unity3d.com/ScriptReference/Vector3-sqrMagnitude.html)

https://github.com/StansAssets/com.stansassets.foundation/blob/master/Runtime/Extensions/UnityEngine/Vector3Extensions.cs#L30-L36

this is the same as return a * s (https://docs.unity3d.com/ScriptReference/Vector3-operator_multiply.html)

https://github.com/StansAssets/com.stansassets.foundation/blob/master/Runtime/Extensions/UnityEngine/Vector3Extensions.cs#L44-L51

this is the same as return Vector3.Sacle(a, b) (https://docs.unity3d.com/ScriptReference/Vector3.Scale.html)

same things apply for Vector2Extensions