summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample5_Descriptor.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-10-15 07:04:38 +0800
committerchai <chaifix@163.com>2020-10-15 07:04:38 +0800
commitb71d5611db087772179505ed10c82ca958900df7 (patch)
tree5160f6af41d45529e435550879e0c87ea59c09a8 /Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample5_Descriptor.cs
parentb1b14c45ce95dcf7b81867d68d6006345d98959e (diff)
+advanced inspector
Diffstat (limited to 'Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample5_Descriptor.cs')
-rw-r--r--Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample5_Descriptor.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample5_Descriptor.cs b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample5_Descriptor.cs
new file mode 100644
index 00000000..9641b787
--- /dev/null
+++ b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample5_Descriptor.cs
@@ -0,0 +1,27 @@
+using UnityEngine;
+using System.Collections;
+
+using AdvancedInspector;
+
+[AdvancedInspector]
+public class AIExample5_Descriptor : MonoBehaviour
+{
+ // The Descriptor attribute is used to give more information about an item.
+ // It can also change the displayed name of the item;
+ [Inspect, Descriptor("Variable New Name", "")]
+ public float myFloat;
+
+ // The second parameter - "Description" - is used as a tooltip in the inspector.
+ [Inspect, Descriptor("With Tooltip", "This is the tooltip description")]
+ public float myFloat2;
+
+ // The third parameter - "URL" - is used as a web info in the inspector.
+ // Try right-clicking on this label to see "Online Help".
+ [Inspect, Descriptor("With URL", "This is the tooltip description", "http://www.lightstrikersoftware.com/")]
+ public float myFloat3;
+
+ // The descriptor also contains a RGB value, that is used to tint the item.
+ // Because of the limits of attributes, the color has to be passed by floats.
+ [Inspect, Descriptor("With Color", "This is the tooltip description", "", 1, 0, 0)]
+ public float myFloat4;
+}