毫无头绪!
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Ichni.Editor
|
||||
unitList = new List<DynamicUICompositeUnit>();
|
||||
closeButton.onClick.AddListener(Quit);
|
||||
|
||||
StartCoroutine(WindowAnim.ShowPanel(gameObject));
|
||||
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
|
||||
}
|
||||
|
||||
public void RemoveUnit(DynamicUICompositeUnit unit)
|
||||
@@ -72,7 +72,7 @@ namespace Ichni.Editor
|
||||
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, stringList);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public void SetAsFloatList()
|
||||
{
|
||||
void GenerateUnit(float content)
|
||||
@@ -81,7 +81,7 @@ namespace Ichni.Editor
|
||||
unitList.Add(unit);
|
||||
unit.SetUnit(this, content);
|
||||
}
|
||||
|
||||
|
||||
unitPrefab = EditorManager.instance.basePrefabs.inputFieldUnit;
|
||||
List<float> list = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement) as List<float>;
|
||||
foreach (float item in list)
|
||||
@@ -89,13 +89,13 @@ namespace Ichni.Editor
|
||||
GenerateUnit(item);
|
||||
}
|
||||
addNewUnitButton.GetComponent<RectTransform>().SetAsLastSibling();
|
||||
|
||||
|
||||
addNewUnitButton.onClick.AddListener(() =>
|
||||
{
|
||||
GenerateUnit(0);
|
||||
addNewUnitButton.GetComponent<RectTransform>().SetAsLastSibling();
|
||||
});
|
||||
|
||||
|
||||
ApplyParameters = () =>
|
||||
{
|
||||
List<float> floatList = unitList.Select(unit => (unit as DynamicUIInputFieldUnit).GetValue<float>()).ToList();
|
||||
@@ -215,23 +215,23 @@ namespace Ichni.Editor
|
||||
unitList.Add(unit);
|
||||
unit.SetUnit(this, content);
|
||||
}
|
||||
|
||||
|
||||
unitPrefab = EditorManager.instance.basePrefabs.customCurveKeyframeUnit;
|
||||
AnimationCurve curve = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement) as AnimationCurve;
|
||||
List<Keyframe> keyframes = curve.keys.ToList();
|
||||
WarpModes warpModes = new WarpModes(curve.preWrapMode, curve.postWrapMode);
|
||||
|
||||
|
||||
//生成warpModes的Unit
|
||||
DynamicUICustomCurveWrapModeUnit warpModesUnit =
|
||||
DynamicUICustomCurveWrapModeUnit warpModesUnit =
|
||||
Instantiate(EditorManager.instance.basePrefabs.customCurveWrapModeUnit, windowRect).GetComponent<DynamicUICustomCurveWrapModeUnit>();
|
||||
unitList.Add(warpModesUnit);
|
||||
warpModesUnit.SetUnit(this, warpModes);
|
||||
|
||||
|
||||
foreach (Keyframe keyframe in keyframes)
|
||||
{
|
||||
GenerateUnit(keyframe);
|
||||
}
|
||||
|
||||
|
||||
addNewUnitButton.GetComponent<RectTransform>().SetAsLastSibling();
|
||||
|
||||
addNewUnitButton.onClick.AddListener(() =>
|
||||
@@ -239,14 +239,14 @@ namespace Ichni.Editor
|
||||
GenerateUnit(new Keyframe(0, 0, 0, 0));
|
||||
addNewUnitButton.GetComponent<RectTransform>().SetAsLastSibling();
|
||||
});
|
||||
|
||||
|
||||
ApplyParameters = () =>
|
||||
{
|
||||
AnimationCurve newCurve = new AnimationCurve();
|
||||
DynamicUICustomCurveWrapModeUnit warpModesUnit = unitList[0] as DynamicUICustomCurveWrapModeUnit;
|
||||
newCurve.preWrapMode = warpModesUnit.GetValue().preWrapMode;
|
||||
newCurve.postWrapMode = warpModesUnit.GetValue().postWrapMode;
|
||||
for(int i = 1; i < unitList.Count; i++)
|
||||
for (int i = 1; i < unitList.Count; i++)
|
||||
{
|
||||
DynamicUICustomCurveKeyframeUnit unit = unitList[i] as DynamicUICustomCurveKeyframeUnit;
|
||||
newCurve.AddKey(unit.GetValue());
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Ichni.Editor
|
||||
|
||||
public void Initialize(GameElement gameElement, string title)
|
||||
{
|
||||
StartCoroutine(WindowAnim.ShowPanel(gameObject));
|
||||
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
|
||||
WindowRect = windowRect;
|
||||
Containers = new List<DynamicUIContainer>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user