-
Notifications
You must be signed in to change notification settings - Fork 92
Making some Types and Properties public to allow building of custom tools with it #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
aa0c524
d42e82b
0c73a20
b8e46c8
c5b46ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ static class ProBuilderToolManager | |||||
|
|
||||||
| [Icon("Packages/com.unity.probuilder/Content/Icons/EditableMesh/EditMeshContext.png")] | ||||||
| [EditorToolContext("ProBuilder", typeof(ProBuilderMesh))] | ||||||
| class PositionToolContext : EditorToolContext | ||||||
| public class PositionToolContext : EditorToolContext | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should make that sealed, so that it's possible to reference it but that should be all.
Suggested change
|
||||||
| { | ||||||
| internal class ProBuilderShortcutContext : IShortcutContext | ||||||
| { | ||||||
|
|
@@ -407,7 +407,7 @@ static void SetColliderAction(MenuCommand command) | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| class TextureToolContext : EditorToolContext | ||||||
| public class TextureToolContext : EditorToolContext | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should make that sealed, so that it's possible to reference it but that should be all.
Suggested change
|
||||||
| { | ||||||
| ProBuilderEditor m_Editor; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,6 @@ protected override void DoToolGUI() | |
| { | ||
| if (!isEditing) | ||
| m_Position = Vector3.zero; | ||
|
|
||
| EditorHandleUtility.PushMatrix(); | ||
|
|
||
| Handles.matrix = Matrix4x4.TRS(m_HandlePosition, m_HandleRotation, Vector3.one); | ||
|
|
@@ -48,22 +47,25 @@ protected override void DoToolGUI() | |
|
|
||
| Handles.color = Color.blue; | ||
|
|
||
| // Disable Snap for the individual handles. Snap is applied if movement is detected. | ||
| const float SnapFactor = 0.0f; | ||
|
|
||
| m_Position = Handles.Slider2D(m_Position, | ||
| Vector3.forward, | ||
| Vector3.right, | ||
| Vector3.up, | ||
| HandleUtility.GetHandleSize(m_Position) * .2f, | ||
| Handles.RectangleHandleCap, | ||
| 0f, | ||
| SnapFactor, | ||
| false); | ||
|
|
||
| Handles.color = Color.green; | ||
|
|
||
| m_Position = Handles.Slider(m_Position, Vector3.up); | ||
| m_Position = Handles.Slider(m_Position, Vector3.up, HandleUtility.GetHandleSize(m_Position), Handles.ArrowHandleCap, SnapFactor); | ||
|
|
||
| Handles.color = Color.red; | ||
|
|
||
| m_Position = Handles.Slider(m_Position, Vector3.right); | ||
| m_Position = Handles.Slider(m_Position, Vector3.right, HandleUtility.GetHandleSize(m_Position), Handles.ArrowHandleCap, SnapFactor); | ||
|
Comment on lines
+50
to
+68
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These can be removed as I'm landing a fix on another PR :D |
||
|
|
||
| Handles.color = Color.white; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make that
sealed, so that it's possible to reference it but that should be all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a fan of sealing things that are not made to be extended. So thumbs up for that.