效果模块,以及代码位置整理

This commit is contained in:
SoulliesOfficial
2025-02-16 11:15:42 -05:00
parent 934d1b5aba
commit d77e1a0f70
204 changed files with 1107 additions and 347 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
namespace Ichni.Editor
{

View File

@@ -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();
}
}

View File

@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
namespace Ichni.Editor
@@ -22,5 +23,10 @@ namespace Ichni.Editor
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, value);
connectedBaseElement.Refresh();
}
public void AddListenerFunction(UnityAction<bool> action)
{
toggle.onValueChanged.AddListener(action);
}
}
}