From f049177e20a276049c61edbad631c1b2bbdd5706 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 15 Oct 2020 19:05:22 +0800 Subject: -advanced inspector +odin --- .../Scripts/Editor/SyncVarAttributeDrawer.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs (limited to 'Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs') diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs new file mode 100644 index 00000000..02d7d1d9 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs @@ -0,0 +1,42 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && !UNITY_2019_1_OR_NEWER +#pragma warning disable 0618 + +namespace Sirenix.OdinInspector.Editor.Drawers +{ + using Sirenix.Utilities; + using UnityEditor; + using UnityEngine; + using UnityEngine.Networking; + + /// + /// SyncVar attribute drawer. + /// + public class SyncVarAttributeDrawer : OdinAttributeDrawer + { + /// + /// Draws the property. + /// + protected override void DrawPropertyLayout(GUIContent label) + { + GUILayout.BeginHorizontal(); + { + GUILayout.BeginVertical(); + { + this.CallNextDrawer(label); + } + GUILayout.EndVertical(); + + GUILayout.Label("SyncVar", EditorStyles.miniLabel, GUILayoutOptions.Width(52f)); + } + GUILayout.EndHorizontal(); + } + } +} + +#endif // UNITY_EDITOR && !UNITY_2019_1_OR_NEWER \ No newline at end of file -- cgit v1.1-26-g67d0