diff options
| author | chai <chaifix@163.com> | 2020-10-15 19:05:22 +0800 |
|---|---|---|
| committer | chai <chaifix@163.com> | 2020-10-15 19:05:22 +0800 |
| commit | f049177e20a276049c61edbad631c1b2bbdd5706 (patch) | |
| tree | 7d1a1cd9b690a5d9a8b9a65554a191d6ec769601 /Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs | |
| parent | 6990a0d1fbdcbbf404f40713363ac1a148c8840a (diff) | |
-advanced inspector
+odin
Diffstat (limited to 'Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs')
| -rw-r--r-- | Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs | 42 |
1 files changed, 42 insertions, 0 deletions
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 file="SyncVarAttributeDrawer.cs" company="Sirenix IVS">
+// Copyright (c) Sirenix IVS. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+#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;
+
+ /// <summary>
+ /// SyncVar attribute drawer.
+ /// </summary>
+ public class SyncVarAttributeDrawer : OdinAttributeDrawer<SyncVarAttribute>
+ {
+ /// <summary>
+ /// Draws the property.
+ /// </summary>
+ 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 |
