From 6990a0d1fbdcbbf404f40713363ac1a148c8840a Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 15 Oct 2020 13:53:27 +0800 Subject: =?UTF-8?q?-advanced=20inspector=20=E5=AF=B92018=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7=E4=B8=8D=E5=A4=AA=E5=A5=BD=EF=BC=8C=E6=94=B9=E7=94=A8?= =?UTF-8?q?Odin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Examples/CSharp/AIExample19_Restrict.cs | 46 ---------------------- 1 file changed, 46 deletions(-) delete mode 100644 Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample19_Restrict.cs (limited to 'Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample19_Restrict.cs') diff --git a/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample19_Restrict.cs b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample19_Restrict.cs deleted file mode 100644 index 0b162a4d..00000000 --- a/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample19_Restrict.cs +++ /dev/null @@ -1,46 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; -using System.Collections.Generic; - -using AdvancedInspector; - -[AdvancedInspector] -public class AIExample19_Restrict : MonoBehaviour -{ - // Unlike other "dynamic" attributes, the Restrict attribute can only work in "dynamic" mode. - // The restrict attribute limits - or restrict - the data that can be input in a field. - // This is quite useful when you want to limit what can be selected. - [Inspect, Restrict("ValidFloats")] - public float[] myFloat; - - private IList ValidFloats() - { - return new float[] { 0, 2, 4, 6, 8, 10 }; - } - - // The restrict attribute can display the choices as a drop down list, a collection of button, or a toolbox popup - // The toolbox popup is quite useful when you have a high number of choices and you want the user to search in them. - [Inspect, Restrict("ValidStrings", RestrictDisplay.Toolbox)] - public string myString; - - private IList ValidStrings() - { - return new string[] { "A", "AA", "A+", "B", "BB", "B+", "C", "CC", "C+", "D", "DD", "D+", "E", "EE", "E+" }; - } - - // Another huge advantage of Restrict, is that you can build your own list of object. - // If you have ScriptableObject, you can do Resources.LoadAll and return a list of those. - // Or you can do FindAll for a specific type. - // Note that you can also add "null" in your collection for the user to "unselect" an object. - [Inspect, Restrict("GetObjects")] - public MonoBehaviour[] myObjects; - - private IList GetObjects() - { - List collection = new List(); - collection.Add(null); - collection.AddRange(GetComponents()); - return collection; - } -} -- cgit v1.1-26-g67d0