Skip to content

Commit 68cd619

Browse files
authored
Merge pull request #392 from Unity-Technologies/bugfix/1332226-missing-gizmos-menu-items
Fix for missing Gizmos Menu items for projects that have ProBuilder installed
2 parents 11abab4 + d9f8ae0 commit 68cd619

5 files changed

Lines changed: 38 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7+
8+
79
## [Unreleased]
810

911
### Bug Fixes
1012

13+
- [case: 1332226] Fixed issue where some Gizmos menu items would be missing in projects that have ProBuilder package installed.
14+
15+
## [5.0.3] - 2021-04-01
16+
17+
### Bug Fixes
18+
1119
- [case: 1324399] Fixing errors when building with prefabs in scene.
1220
- [case: 1323666] Preventing to assign an empty mesh as MeshCollider.
1321
- [case: 1322032] Fixing wrong ProBuilderMesh colors on domain reload when null.

Editor/EditorCore/HierarchyListener.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ static class HierarchyListener
1212
{
1313
static HierarchyListener()
1414
{
15-
// The inspector icon for ProBuilderMesh is set in the component metadata. However, this also serves as the
16-
// scene view gizmo icon, which we do not want. To avoid drawing an icon for every mesh in the Scene View,
17-
// we simply tell the AnnotationManager to not render the icon. This _does_ put ProBuilderMesh in the
18-
// "Recently Changed" list, but only when it is modified the first time.
19-
// The alternative method of setting an icon is to place it in a folder named "Editor Default Resources/Icons",
20-
// however that requires that the resources directory be in "Assets", which we do not want to do.
21-
EditorUtility.SetGizmoIconEnabled(typeof(ProBuilderMesh), false);
22-
15+
AssemblyReloadEvents.afterAssemblyReload += OnAfterAssemblyReload;
2316
// When a prefab is updated, this is raised. For some reason it's
2417
// called twice?
2518
EditorApplication.hierarchyChanged += HierarchyWindowChanged;
@@ -29,6 +22,17 @@ static HierarchyListener()
2922
PrefabUtility.prefabInstanceUpdated += PrefabInstanceUpdated;
3023
}
3124

25+
static void OnAfterAssemblyReload()
26+
{
27+
// The inspector icon for ProBuilderMesh is set in the component metadata. However, this also serves as the
28+
// scene view gizmo icon, which we do not want. To avoid drawing an icon for every mesh in the Scene View,
29+
// we simply tell the AnnotationManager to not render the icon. This _does_ put ProBuilderMesh in the
30+
// "Recently Changed" list, but only when it is modified the first time.
31+
// The alternative method of setting an icon is to place it in a folder named "Editor Default Resources/Icons",
32+
// however that requires that the resources directory be in "Assets", which we do not want to do.
33+
EditorApplication.delayCall += () => EditorUtility.SetGizmoIconEnabled(typeof(ProBuilderMesh), false);
34+
}
35+
3236
static void PrefabInstanceUpdated(GameObject go)
3337
{
3438
if (EditorApplication.isPlayingOrWillChangePlaymode)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.unity.probuilder",
33
"displayName": "ProBuilder",
4-
"version": "5.0.2",
4+
"version": "5.0.3",
55
"unity": "2019.4",
66
"description": "Build, edit, and texture custom geometry in Unity. Use ProBuilder for in-scene level design, prototyping, collision meshes, all with on-the-fly play-testing.\n\nAdvanced features include UV editing, vertex colors, parametric shapes, and texture blending. With ProBuilder's model export feature it's easy to tweak your levels in any external 3D modelling suite.\n\nIf you are using URP/HDRP, be careful to also import the corresponding sample project in the section below to get the proper materials.",
77
"keywords": [
@@ -58,4 +58,4 @@
5858
"url": "https://github.com/Unity-Technologies/com.unity.probuilder.git",
5959
"revision": "ea0bd0c969779f359c7ca6e065338ac39a93c86a"
6060
}
61-
}
61+
}

validationExceptions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Exceptions":
3+
[
4+
{
5+
"ValidationTest": "API Validation",
6+
"PackageVersion": "5.0.3"
7+
}
8+
]
9+
}

validationExceptions.json.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)