重构inspector!

This commit is contained in:
SoulliesOfficial
2025-04-14 17:49:47 -04:00
parent bbca8b43fe
commit 11543b4997
81 changed files with 1037 additions and 903 deletions

View File

@@ -35,15 +35,16 @@ namespace Ichni.Editor
Destroy(unit.gameObject);
}
public void AddListenerFunction(UnityAction action)
public CompositeParameterWindow AddListenerFunction(UnityAction action)
{
onQuit = action;
return this;
}
}
public partial class CompositeParameterWindow
{
public void SetAsStringList()
public CompositeParameterWindow SetAsStringList()
{
//生成Unit
void GenerateUnit(string content)
@@ -76,9 +77,11 @@ namespace Ichni.Editor
List<string> stringList = unitList.Select(unit => (unit as DynamicUIInputFieldUnit).GetValue<string>()).ToList();
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, stringList);
};
return this;
}
public void SetAsFloatList()
public CompositeParameterWindow SetAsFloatList()
{
void GenerateUnit(float content)
{
@@ -106,9 +109,11 @@ namespace Ichni.Editor
List<float> floatList = unitList.Select(unit => (unit as DynamicUIInputFieldUnit).GetValue<float>()).ToList();
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, floatList);
};
return this;
}
public void SetAsFlexibleFloat()
public CompositeParameterWindow SetAsFlexibleFloat()
{
void GenerateUnit(AnimatedFloat content)
{
@@ -141,9 +146,11 @@ namespace Ichni.Editor
}
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, newFlexibleFloat);
};
return this;
}
public void SetAsFlexibleInt()
public CompositeParameterWindow SetAsFlexibleInt()
{
void GenerateUnit(AnimatedInt content)
{
@@ -176,9 +183,11 @@ namespace Ichni.Editor
}
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, newFlexibleInt);
};
return this;
}
public void SetAsFlexibleBool()
public CompositeParameterWindow SetAsFlexibleBool()
{
void GenerateUnit(AnimatedBool content)
{
@@ -210,9 +219,11 @@ namespace Ichni.Editor
}
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, newFlexibleBool);
};
return this;
}
public void SetAsCustomCurve()
public CompositeParameterWindow SetAsCustomCurve()
{
void GenerateUnit(Keyframe content)
{
@@ -258,9 +269,11 @@ namespace Ichni.Editor
}
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, newCurve);
};
return this;
}
public void SetAsStringIntDictionary()
public CompositeParameterWindow SetAsStringIntDictionary()
{
//生成Unit
void GenerateUnit(KeyValuePair<string, int> content)
@@ -298,6 +311,8 @@ namespace Ichni.Editor
}
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, dictionaryList);
};
return this;
}
}
}