summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-10-15 13:53:27 +0800
committerchai <chaifix@163.com>2020-10-15 13:53:27 +0800
commit6990a0d1fbdcbbf404f40713363ac1a148c8840a (patch)
treecbd92c7a47e12c30cba3300eb349d9c43ce512ab /Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs
parente846c64d6f927879cb8a095e62d773a8d7b3c9f4 (diff)
-advanced inspector 对2018兼容性不太好,改用Odin
Diffstat (limited to 'Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs')
-rw-r--r--Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample7_Collection.cs64
1 files changed, 0 insertions, 64 deletions
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<bool> dropDownList;
-
- // A collection size and index can also be bound to an enum type.
- [Collection(typeof(MyCollectionEnum))]
- public List<Vector3> 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