From b71d5611db087772179505ed10c82ca958900df7 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 15 Oct 2020 07:04:38 +0800 Subject: +advanced inspector --- .../Examples/CSharp/AIExample6_DescriptorDynamic.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample6_DescriptorDynamic.cs (limited to 'Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample6_DescriptorDynamic.cs') diff --git a/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample6_DescriptorDynamic.cs b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample6_DescriptorDynamic.cs new file mode 100644 index 00000000..baa50f83 --- /dev/null +++ b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample6_DescriptorDynamic.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; + +using AdvancedInspector; + +[AdvancedInspector] +public class AIExample6_DescriptorDynamic : MonoBehaviour +{ + // If you give only a single string to the descriptor attribute, it will try to find a function with that name. + // Similar to the Inspect Dynamic example, it allows to change how something is drawn at runtime. + [Inspect, Descriptor("GetDescriptor")] + public string myName = "Change me!"; + + private DescriptorAttribute GetDescriptor() + { + return new DescriptorAttribute(myName, "Every item can be changed"); + } +} -- cgit v1.1-26-g67d0