效果模块,以及代码位置整理
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame;
|
||||
@@ -20,7 +21,19 @@ namespace Ichni.Editor
|
||||
|
||||
private void ApplyParameters(string text)
|
||||
{
|
||||
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, text);
|
||||
Type type = connectedBaseElement.GetType().GetField(parameterName).FieldType;
|
||||
if (type == typeof(int))
|
||||
{
|
||||
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, int.Parse(text));
|
||||
}
|
||||
else if (type == typeof(float))
|
||||
{
|
||||
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, float.Parse(text));
|
||||
}
|
||||
else if (type == typeof(string))
|
||||
{
|
||||
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, text);
|
||||
}
|
||||
connectedBaseElement.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user