diff --git a/CHANGELOG.md b/CHANGELOG.md index 91eb9c8f3..b15d4facf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ 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. - [UUM-138960] Removed a large utility dictionary to reduce binary size and runtime memory overhead. ### Fixed 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 8f5ec4e5d..000000000 --- a/Editor/EditorCore/pb_ObjectArray.cs +++ /dev/null @@ -1,69 +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 (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); - } - } - } - - 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}