Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [6.0.8] - 2025-11-17

### Changes
- PositionToolContext made public
- TextureToolContext made public
- MeshSelection.totalVertexCountOptimized made public
- CutTool made public

### Fixed

- [PBLD-240] Fixed a bug where buttons for "Create Cube" and "Create PolyShape" appeared incorrectly on Light theme.
Expand Down
2 changes: 1 addition & 1 deletion Editor/EditorCore/CutTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace UnityEditor.ProBuilder
{
[EditorTool("Cut Tool", typeof(ProBuilderMesh), typeof(PositionToolContext))]
class CutTool : EditorTool
public class CutTool : EditorTool

Copy link
Copy Markdown
Collaborator

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.

Suggested change
public class CutTool : EditorTool
public sealed class CutTool : EditorTool

Copy link
Copy Markdown
Author

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.

{
ProBuilderMesh m_Mesh;

Expand Down
7 changes: 5 additions & 2 deletions Editor/EditorCore/MeshSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,11 @@ internal static bool Contains(ProBuilderMesh mesh)
/// Gets the number of all selected vertices across the selected ProBuilder meshes, excluding coincident duplicates.
/// </summary>
public static int totalCommonVertexCount { get { CacheElementCounts(); return s_TotalCommonVertexCount; } }

internal static int totalVertexCountOptimized { get { CacheElementCounts(); return s_TotalVertexCountCompiled; } }

/// <summary>
/// Gets the number of all selected ProBuilder compiled mesh vertices.
/// </summary>
public static int totalVertexCountOptimized { get { CacheElementCounts(); return s_TotalVertexCountCompiled; } }

/// <summary>
/// Gets the sum of all selected ProBuilderMesh faces.
Expand Down
4 changes: 2 additions & 2 deletions Editor/EditorCore/ProBuilderToolsContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Collaborator

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.

Suggested change
public class PositionToolContext : EditorToolContext
public sealed class PositionToolContext : EditorToolContext

{
internal class ProBuilderShortcutContext : IShortcutContext
{
Expand Down Expand Up @@ -407,7 +407,7 @@ static void SetColliderAction(MenuCommand command)
}
}

class TextureToolContext : EditorToolContext
public class TextureToolContext : EditorToolContext

Copy link
Copy Markdown
Collaborator

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.

Suggested change
public class TextureToolContext : EditorToolContext
public sealed class TextureToolContext : EditorToolContext

{
ProBuilderEditor m_Editor;

Expand Down
10 changes: 6 additions & 4 deletions Editor/EditorCore/TextureMoveTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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;

Expand Down