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/AIExample7_Collection.cs | 64 ---------------------- 1 file changed, 64 deletions(-) delete mode 100644 Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs (limited to 'Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs') diff --git a/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs b/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs deleted file mode 100644 index 49ec53be..00000000 --- a/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs +++ /dev/null @@ -1,64 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; -using System.Collections.Generic; - -using AdvancedInspector; - -public class AIExample7_Collection : MonoBehaviour -{ - // Any collection inspected by Advanced Inspector has the re-ordering controls. - public float[] myArray; - - // The collection attribute gives you control on how the collection is displayed. - // Giving it a number forces the collection to be of a fixed size, it cannot grow or shrink. - [Collection(10)] - public int[] fixedArray; - - // You can also turn off the sortable feature of an array, if for example item should be listed in a specific order. - [Collection(false)] - public bool[] unsortableArray; - - // Collection can also be displayed 1 item at a time. You can use a drop down or buttons to navigate in it. - [Collection(Display = CollectionDisplay.DropDown)] - public List dropDownList; - - // A collection size and index can also be bound to an enum type. - [Collection(typeof(MyCollectionEnum))] - public List enumBoundList; - - // Very large collection get a scrolling system to not display them all at once. - [Collection(100, MaxDisplayedItems = 10)] - public string[] largeCollection; - - // In some case, you may want a class to have a custom constructor. - // Usually, Unity is unable to invoke that constructor. - [Serializable] - public class CustomConstructor - { - public string value; - - public CustomConstructor(string text) - { - value = text; - } - } - - [Constructor("InvokeConstructor")] - public CustomConstructor[] constructors; - - public CustomConstructor InvokeConstructor() - { - return new CustomConstructor("This was added in a constructor"); - } -} - -// When binding an enum with a collection, the values should be in a zero-based 1 increment order, similar to the index of the collection. -public enum MyCollectionEnum -{ - ZeroValue = 0, - FirstValue = 1, - SecondValue = 2, - ThirdValue = 3, - ForthValue = 4 -} \ No newline at end of file -- cgit v1.1-26-g67d0