2using System.Collections;
3using System.Reflection;
11 [pb_TypeInspector(typeof(ICollection))]
15 const int MAX_COLLECTION_LENGTH = 32;
30 title.text = GetName().SplitCamelCase();
32 value = GetValue<ICollection>();
37 array = value.Cast<
object>().ToArray();
39 if(array.Length < 1 || array.Length > 32)
42 if(declaringType ==
null || declaringType.GetElementType() ==
null)
45 System.Type elementType = declaringType.GetElementType();
47 string typeName = elementType.ToString().Substring(elementType.ToString().LastIndexOf(
'.') + 1);
49 for(
int i = 0; i < array.Length; i++)
51 pb_TypeInspector inspector = pb_InspectorResolver.GetInspector(elementType);
52 inspector.SetIndexInCollection(i);
53 inspector.Initialize( typeName,
54 (
int index) => {
return array[index]; },
61 private void SetValueAtIndex(
int index,
object val)
64 Debug.LogWarning(
"Setting values in a collection is not supported yet!");
70 value = GetValue<ICollection>();
75 int prev_length = array.Length;
77 array = value.Cast<
object>().ToArray();
79 if(array.Length < 1 || array.Length > 32)
82 if(prev_length != array.Length)
84 foreach(Transform t
in transform)
85 pb_ObjectUtility.Destroy(t.gameObject);
override void OnUpdateGUI()
override void InitializeGUI()
UnityEngine.UI.Text title