1.6.0: Added FieldLabelFromType, StringToAnimationClipName and SingleSelectionFlag
This commit is contained in:
parent
7d99d62e11
commit
9faacb6291
15 changed files with 215 additions and 6 deletions
|
|
@ -428,11 +428,30 @@ namespace Module.Inspector.Editor
|
|||
foreach (string path in property.propertyPath.Split('.'))
|
||||
{
|
||||
Type objType = obj.GetType();
|
||||
|
||||
if (objType.IsArray)
|
||||
{
|
||||
if (path.Equals("Array"))
|
||||
continue;
|
||||
|
||||
objType = objType.GetElementType();
|
||||
|
||||
if (path.StartsWith("data["))
|
||||
{
|
||||
int index = int.Parse(path.Substring(5, path.Length - 6));
|
||||
var arr = (object[])obj;
|
||||
obj = arr[index];
|
||||
}
|
||||
}
|
||||
|
||||
if (objType == null)
|
||||
continue;
|
||||
|
||||
FieldInfo field = objType.GetField(path, FLAGS);
|
||||
|
||||
if (field == null)
|
||||
continue;
|
||||
|
||||
|
||||
obj = field.GetValue(obj);
|
||||
type = field.FieldType;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue