From 2d9bf1321158ce05ccdee0858031a365b739ad7c Mon Sep 17 00:00:00 2001 From: Thomasch-unity3d <30902625+Thomasch-unity3d@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:53:13 -0400 Subject: [PATCH 1/3] Hide reference to ProceduralMaterial. --- Editor/EditorCore/pb_ObjectArray.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Editor/EditorCore/pb_ObjectArray.cs b/Editor/EditorCore/pb_ObjectArray.cs index 8f5ec4e5d..90542778b 100644 --- a/Editor/EditorCore/pb_ObjectArray.cs +++ b/Editor/EditorCore/pb_ObjectArray.cs @@ -29,6 +29,16 @@ public T[] GetArray() for (int i = 0; i < array.Length; i++) { +#if UNITY_6000_6_OR_NEWER + if (array[i] is T) + { + arr[i] = (T)System.Convert.ChangeType(array[i], typeof(T)); + } + else + { + arr[i] = default(T); + } +#else if (array[i] is ProceduralMaterial) { arr[i] = (T)System.Convert.ChangeType(array[i], typeof(ProceduralMaterial)); @@ -44,8 +54,8 @@ public T[] GetArray() arr[i] = default(T); } } +#endif } - return (T[])arr; } From e518233fc3407b9a9b9c532d9584c5ff9462ed59 Mon Sep 17 00:00:00 2001 From: Thomas Lopez Date: Tue, 31 Mar 2026 16:03:12 -0400 Subject: [PATCH 2/3] remove class obsolete for the past 8 years --- Editor/EditorCore/MaterialEditor.cs | 18 +----- Editor/EditorCore/pb_ObjectArray.cs | 79 ------------------------ Editor/EditorCore/pb_ObjectArray.cs.meta | 7 --- 3 files changed, 1 insertion(+), 103 deletions(-) delete mode 100644 Editor/EditorCore/pb_ObjectArray.cs delete mode 100644 Editor/EditorCore/pb_ObjectArray.cs.meta diff --git a/Editor/EditorCore/MaterialEditor.cs b/Editor/EditorCore/MaterialEditor.cs index 4729d4b2c..55855e28e 100644 --- a/Editor/EditorCore/MaterialEditor.cs +++ b/Editor/EditorCore/MaterialEditor.cs @@ -173,24 +173,8 @@ public static MaterialPalette CurrentPalette if (s_CurrentPalette != null) return s_CurrentPalette; - // If no existing pb_MaterialPalette objects in project: - // - create a new one - // - check for the older pb_ObjectArray and copy data to new default + // If no existing pb_MaterialPalette objects in project create a new one s_CurrentPalette = FileUtility.LoadRequired(s_MaterialPalettePath); - - string[] m_LegacyMaterialArrays = AssetDatabase.FindAssets("t:pb_ObjectArray"); - - for (int i = 0; m_LegacyMaterialArrays != null && i < m_LegacyMaterialArrays.Length; i++) - { - pb_ObjectArray poa = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(m_LegacyMaterialArrays[i])); - - // Make sure there's actually something worth copying - if (poa != null && poa.array != null && poa.array.Any(x => x != null && x is Material)) - { - s_CurrentPalette.array = poa.GetArray(); - break; - } - } } return s_CurrentPalette; } diff --git a/Editor/EditorCore/pb_ObjectArray.cs b/Editor/EditorCore/pb_ObjectArray.cs deleted file mode 100644 index 90542778b..000000000 --- a/Editor/EditorCore/pb_ObjectArray.cs +++ /dev/null @@ -1,79 +0,0 @@ -using UnityEngine; -using System.Collections; -using UnityEngine.ProBuilder; - -namespace UnityEditor.ProBuilder -{ - /** - * Used to store arrays of materials. Made obsolete by pb_MaterialArray. - * - * Notes: - * - In the Editor folder because WebGL doesn't like ProceduralMaterial types. - * - Named pb_ObjectArray because this was initially intended to be a base type for - * other save-able object types. It is only used for materials, but changing the name - * to something more suitable would mean breaking existing material palettes for - * lots of people. - */ - [System.Obsolete( - "pb_ObjectArray is deprecated. ProBuilder Material Editor now saves material palettes as pb_MaterialArray. You may safely delete this asset.")] - [System.Serializable] - // ReSharper disable once InconsistentNaming - sealed class pb_ObjectArray : ScriptableObject, IHasDefault - { - // Stored as object for backwards compatibility. - [SerializeField] public Object[] array; - - public T[] GetArray() - { - T[] arr = new T[array.Length]; - - for (int i = 0; i < array.Length; i++) - { -#if UNITY_6000_6_OR_NEWER - if (array[i] is T) - { - arr[i] = (T)System.Convert.ChangeType(array[i], typeof(T)); - } - else - { - arr[i] = default(T); - } -#else - if (array[i] is ProceduralMaterial) - { - arr[i] = (T)System.Convert.ChangeType(array[i], typeof(ProceduralMaterial)); - } - else - { - if (array[i] is T) - { - arr[i] = (T)System.Convert.ChangeType(array[i], typeof(T)); - } - else - { - arr[i] = default(T); - } - } -#endif - } - return (T[])arr; - } - - public void SetDefaultValues() - { - array = new Material[10] - { - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - }; - } - } -} diff --git a/Editor/EditorCore/pb_ObjectArray.cs.meta b/Editor/EditorCore/pb_ObjectArray.cs.meta deleted file mode 100644 index c9a0aef3e..000000000 --- a/Editor/EditorCore/pb_ObjectArray.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c8a5a39fbad44b97b5f27e8a2e28aecf -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} From 1db3c2a86b96283328739ec9cd4931014c5823f2 Mon Sep 17 00:00:00 2001 From: Thomas Lopez Date: Tue, 31 Mar 2026 16:06:48 -0400 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24a13e765..ae6d08683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +### Changes + +- [UUM-138539] Removed the pb_ObjectArray file that was deprecated 8 years ago and is not used amymore. + ### Fixed - [UUM-133861] Fixed "Look rotation viewing vector is zero" log being spammed when holding shift while using a create tool such as Create Sprite.