big fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Ichni.RhythmGame;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
@@ -290,8 +291,8 @@ namespace Ichni.Editor
|
||||
DynamicUICustomCurveKeyframeUnit unit = unitList[i] as DynamicUICustomCurveKeyframeUnit;
|
||||
newCurve.AddKey(unit.GetValue());
|
||||
}
|
||||
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, newCurve);
|
||||
|
||||
FieldInfo fieldInfo = connectedBaseElement.GetType().GetField(parameterName);
|
||||
fieldInfo.SetValue(connectedBaseElement, newCurve);
|
||||
};
|
||||
return this;
|
||||
}
|
||||
@@ -327,7 +328,13 @@ namespace Ichni.Editor
|
||||
{
|
||||
newColorKeys.Add((unit as DynamicUIGradientColorKeyUnit).GetValue());
|
||||
}
|
||||
(connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement) as Gradient).colorKeys = newColorKeys.ToArray();
|
||||
FieldInfo fieldInfo = connectedBaseElement.GetType().GetField(parameterName);
|
||||
Gradient originalGradient = fieldInfo.GetValue(connectedBaseElement) as Gradient;
|
||||
Gradient newIndependentGradient = new Gradient();
|
||||
newIndependentGradient.alphaKeys = originalGradient.alphaKeys;
|
||||
newIndependentGradient.mode = originalGradient.mode;
|
||||
newIndependentGradient.colorKeys = newColorKeys.ToArray();
|
||||
fieldInfo.SetValue(connectedBaseElement, newIndependentGradient);
|
||||
};
|
||||
|
||||
return this;
|
||||
@@ -364,7 +371,13 @@ namespace Ichni.Editor
|
||||
{
|
||||
newAlphaKeys.Add((unit as DynamicUIGradientAlphaKeyUnit).GetValue());
|
||||
}
|
||||
(connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement) as Gradient).alphaKeys = newAlphaKeys.ToArray();
|
||||
FieldInfo fieldInfo = connectedBaseElement.GetType().GetField(parameterName);
|
||||
Gradient originalGradient = fieldInfo.GetValue(connectedBaseElement) as Gradient;
|
||||
Gradient newIndependentGradient = new Gradient();
|
||||
newIndependentGradient.colorKeys = originalGradient.colorKeys;
|
||||
newIndependentGradient.mode = originalGradient.mode;
|
||||
newIndependentGradient.alphaKeys = newAlphaKeys.ToArray();
|
||||
fieldInfo.SetValue(connectedBaseElement, newIndependentGradient);
|
||||
};
|
||||
|
||||
return this;
|
||||
@@ -406,7 +419,8 @@ namespace Ichni.Editor
|
||||
KeyValuePair<string, int> pair = (unit as DynamicUIStringIntPairUnit).GetValue();
|
||||
dictionaryList.Add(pair.Key, pair.Value);
|
||||
}
|
||||
connectedBaseElement.GetType().GetField(parameterName).SetValue(connectedBaseElement, dictionaryList);
|
||||
FieldInfo fieldInfo = connectedBaseElement.GetType().GetField(parameterName);
|
||||
fieldInfo.SetValue(connectedBaseElement, dictionaryList);
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
@@ -77,6 +77,8 @@ namespace Ichni.Editor
|
||||
var clipSettings = container.GenerateSubcontainer(3);
|
||||
var applyClipButton = escapeConfirmWindow.GenerateButton(clipSettings, "Yes", () =>
|
||||
{
|
||||
InformationTransistor.instance.isLoadedProject = true;
|
||||
InformationTransistor.instance.loadedProjectName = EditorManager.instance.projectInformation.projectName;
|
||||
SceneManager.LoadScene("EditorScene");
|
||||
});
|
||||
var cancelButton = escapeConfirmWindow.GenerateButton(clipSettings, "No", () =>
|
||||
|
||||
@@ -123,14 +123,15 @@ namespace Ichni
|
||||
public void LoadProject(string projectName)
|
||||
{
|
||||
if (!InformationTransistor.instance.isRecovery)
|
||||
|
||||
{
|
||||
projectManager.loadManager.Load(projectName);
|
||||
Debug.Log("Loaded");
|
||||
}
|
||||
else
|
||||
{
|
||||
projectManager.loadManager.LoadExport(projectName);
|
||||
}
|
||||
|
||||
musicPlayer.audioSource.clip = songInformation.song;
|
||||
beatmapContainer.gameElementList.ForEach(gameElement =>
|
||||
{
|
||||
|
||||
@@ -186,7 +186,6 @@ namespace Ichni
|
||||
|
||||
public void LoadExport(string projectName)
|
||||
{
|
||||
|
||||
LoadProjectInfoExport(projectName);
|
||||
LoadSongInfoExport(projectName);
|
||||
LoadCommandScriptsExport(projectName);
|
||||
@@ -482,7 +481,7 @@ namespace Ichni
|
||||
private void AutoSave()
|
||||
{
|
||||
List<string> saveFiles = GetSortedSaveFiles();
|
||||
|
||||
|
||||
if (saveFiles.Count > 0)
|
||||
{
|
||||
// 删除最旧的存档(如果超过数量)
|
||||
@@ -491,8 +490,14 @@ namespace Ichni
|
||||
string oldestSave = saveFiles[saveFiles.Count - 1];
|
||||
File.Delete(oldestSave);
|
||||
saveFiles.RemoveAt(saveFiles.Count - 1);
|
||||
|
||||
LogWindow.Log("AutoSave finished, the oldest file deleted");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
LogWindow.Log("AutoSave finished");
|
||||
}
|
||||
|
||||
// 依次重命名存档
|
||||
for (int i = saveFiles.Count - 1; i >= 0; i--)
|
||||
{
|
||||
@@ -521,7 +526,7 @@ namespace Ichni
|
||||
Directory.CreateDirectory(autoSavePath);
|
||||
}
|
||||
|
||||
List<string> saveFiles = new List<string>(Directory.GetFiles(autoSavePath, "AutoSave_*.es3"));
|
||||
List<string> saveFiles = new List<string>(Directory.GetFiles(autoSavePath, "AutoSave_*.json"));
|
||||
saveFiles.Sort(string.Compare);
|
||||
return saveFiles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user