From 0fd77fee4f00534da9580cc1bc29d29ffd93ee9f Mon Sep 17 00:00:00 2001 From: VladV Date: Wed, 5 Apr 2023 21:32:32 +0400 Subject: [PATCH] Move InlineEditor to decorators --- Editor.Extras/Drawers/InlineEditorDrawer.cs | 2 +- .../Decorators_InlineEditorSample.cs} | 2 +- .../Decorators_InlineEditorSample.cs.meta} | 0 README.md | 18 +++++++++--------- 4 files changed, 11 insertions(+), 11 deletions(-) rename Editor.Samples/{Styling/Styling_InlineEditorSample.cs => Decorators/Decorators_InlineEditorSample.cs} (59%) rename Editor.Samples/{Styling/Styling_InlineEditorSample.cs.meta => Decorators/Decorators_InlineEditorSample.cs.meta} (100%) diff --git a/Editor.Extras/Drawers/InlineEditorDrawer.cs b/Editor.Extras/Drawers/InlineEditorDrawer.cs index 0bf96c6..d1a2cdb 100644 --- a/Editor.Extras/Drawers/InlineEditorDrawer.cs +++ b/Editor.Extras/Drawers/InlineEditorDrawer.cs @@ -6,7 +6,7 @@ using UnityEngine; using Object = UnityEngine.Object; -[assembly: RegisterTriAttributeDrawer(typeof(InlineEditorDrawer), TriDrawerOrder.Drawer - 100, +[assembly: RegisterTriAttributeDrawer(typeof(InlineEditorDrawer), TriDrawerOrder.Decorator, ApplyOnArrayElement = true)] namespace TriInspector.Drawers diff --git a/Editor.Samples/Styling/Styling_InlineEditorSample.cs b/Editor.Samples/Decorators/Decorators_InlineEditorSample.cs similarity index 59% rename from Editor.Samples/Styling/Styling_InlineEditorSample.cs rename to Editor.Samples/Decorators/Decorators_InlineEditorSample.cs index eab870b..e7fcc45 100644 --- a/Editor.Samples/Styling/Styling_InlineEditorSample.cs +++ b/Editor.Samples/Decorators/Decorators_InlineEditorSample.cs @@ -1,7 +1,7 @@ using TriInspector; using UnityEngine; -public class Styling_InlineEditorSample : ScriptableObject +public class Decorators_InlineEditorSample : ScriptableObject { [InlineEditor] public Material mat; diff --git a/Editor.Samples/Styling/Styling_InlineEditorSample.cs.meta b/Editor.Samples/Decorators/Decorators_InlineEditorSample.cs.meta similarity index 100% rename from Editor.Samples/Styling/Styling_InlineEditorSample.cs.meta rename to Editor.Samples/Decorators/Decorators_InlineEditorSample.cs.meta diff --git a/README.md b/README.md index bc1b467..f003c79 100644 --- a/README.md +++ b/README.md @@ -248,6 +248,15 @@ private IEnumerable> GetVectorValues() [Scene] public string scene; ``` +#### InlineEditor + +![InlineEditor](https://user-images.githubusercontent.com/26966368/168234617-86a7f500-e635-46f8-90f2-5696e5ae7e63.png) + +```csharp +[InlineEditor] +public Material mat; +``` + #### DisplayAsString ![DisplayAsString](https://user-images.githubusercontent.com/26966368/224530522-8aa24fbe-4bc7-4290-89d1-d88c5c502e2b.png) @@ -392,15 +401,6 @@ public Vector3 vec; public string DynamicTooltip => DateTime.Now.ToShortTimeString(); ``` -#### InlineEditor - -![InlineEditor](https://user-images.githubusercontent.com/26966368/168234617-86a7f500-e635-46f8-90f2-5696e5ae7e63.png) - -```csharp -[InlineEditor] -public Material mat; -``` - #### InlineProperty ![InlineProperty](https://user-images.githubusercontent.com/26966368/168234909-1e6bec90-18ed-4d56-91ca-fe09118e1b72.png)