summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample17_HelpDynamic.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample17_HelpDynamic.cs')
-rw-r--r--Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample17_HelpDynamic.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample17_HelpDynamic.cs b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample17_HelpDynamic.cs
new file mode 100644
index 00000000..55d76192
--- /dev/null
+++ b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample17_HelpDynamic.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+using System;
+using System.Collections;
+
+using AdvancedInspector;
+
+[AdvancedInspector]
+public class AIExample17_HelpDynamic : MonoBehaviour
+{
+ // Similar to Inspect or Descriptor, the Help attribute can also be dynamic;
+ [Inspect, Help("GetHelp")]
+ public float myField;
+
+ private HelpAttribute GetHelp()
+ {
+ if (myField > 0)
+ return new HelpAttribute(HelpType.Info, "Change me to a negative value.");
+ else if (myField < 0)
+ return new HelpAttribute(HelpType.Warning, "Change me for positive!");
+ else
+ return new HelpAttribute(HelpType.Error, "Change me!!");
+ }
+}