Fixed Unity 6000.5 serialization warnings

Removed obsolete entities window from toolbar sample
This commit is contained in:
Anders Ejlersen 2026-06-16 19:21:51 +02:00
parent 127702c4f7
commit 7a675c6c85
12 changed files with 65 additions and 10 deletions

View file

@ -13,6 +13,9 @@ namespace Module.NavigationTool.Editor.Favorite
{
public static readonly string PREF_ID = "PREF_FAVORITE_LIST";
#if UNITY_6000_5_OR_NEWER
[SerializeReference]
#endif
public List<Entry> entries;
public Favorites()
@ -236,6 +239,9 @@ namespace Module.NavigationTool.Editor.Favorite
public bool isAsset;
public bool expanded;
public int indentLevel;
#if UNITY_6000_5_OR_NEWER
[SerializeReference]
#endif
public List<Child> children;
[NonSerialized]

View file

@ -41,7 +41,7 @@ namespace Module.NavigationTool.Editor.Favorite
return;
styles.Initialize(GUI.skin);
var rectTools = new Rect(0.0f, 0.0f, position.width, EditorGUIUtility.singleLineHeight);
var rectTools = new Rect(2.0f, 0.0f, position.width - 4f, EditorGUIUtility.singleLineHeight);
var rectList = new Rect(0.0f, rectTools.yMax, position.width, position.height - rectTools.height);
viewTools.Initialize();

View file

@ -25,7 +25,7 @@ namespace Module.NavigationTool.Editor.Favorite
toolbox = new GUIStyle(skin.box);
buttonAddFolder = new GUIStyle(skin.button);
buttonAddFolder.padding = new RectOffset(4, 0, 0, 4);
buttonAddFolder.padding = new RectOffset(4, 4, 2, 2);
entry = new GUIStyle(skin.label);
entry.hover.textColor = entry.onHover.textColor = Color.white;

View file

@ -1,7 +1,9 @@
using UnityEngine;
using System;
using UnityEngine;
namespace Module.NavigationTool.Editor.Favorite
{
[Serializable]
internal abstract class AbstractEditorFavoritesView
{
public abstract void Initialize();

View file

@ -15,17 +15,18 @@ namespace Module.NavigationTool.Editor.Favorite
public override void Draw(EditorFavoritesWindow window, Rect rect, Styles styles)
{
float dim = rect.height;
float dimWidth = 24.0f;
float dimHeight = rect.height;
GUI.BeginGroup(rect, styles.toolbox);
{
var r0 = new Rect(0.0f, 0.0f, rect.width - dim, dim);
var r1 = new Rect(rect.width - r0.height, 0.0f, dim, dim);
var r0 = new Rect(0.0f, 0.0f, rect.width - dimWidth, dimHeight);
var r1 = new Rect(rect.width - dimWidth, 0.0f, dimWidth, dimHeight);
searchStr = EditorGUI.TextField(r0, searchStr);
if (GUI.Button(r1, "+", styles.buttonAddFolder))
EditorFavoritesPopupWindowAddFolder.Show(new Vector2(r1.xMax, dim), null);
EditorFavoritesPopupWindowAddFolder.Show(new Vector2(r1.xMax, dimHeight), null);
}
GUI.EndGroup();
}