popcron / gizmos

Used for drawing runtime gizmos in builds and editor (Unity3D)
MIT License
548 stars 43 forks source link

Changed namespace - Fixing conflicts with UnityEngine.Gizmos #2

Closed RunninglVlan closed 5 years ago

RunninglVlan commented 5 years ago

The package uses the same class name as the built-in gizmo class, if you'd like to specify the built-in one, explictly call UntiyEngine.Gizmos.X(). On the other hand, you can also point to this package's gizmo class with global::Gizmos.

I believe having global class in a Package is a really bad idea. After just trying to experiment with it, I started having conflicts in our other scripts that referenced UnityEngine's Gizmos. As I believe Packages shouldn't require changing other source code just to use them, I suggest this fix - change Package namespace from Popcron.Gizmos to simply Popcron, add Gizmos inside this namespace and reference it in scripts using full namespace, e.g. Popcron.Gizmos.Cube(transform.position, transform.rotation, transform.lossyScale)

@popcron, if you don't like it, then please fix this issue otherwise.

popcron commented 5 years ago

I was starting to have conflicts elsewhere too (other packages that use gizmos). In hindsight, it's not that good of an idea at all. Only inconvenience is that you will have to have an alias to the specific gizmo class.

I'll merge this and increase the package version number. Thank you.