基础内容11 - SAVE LOAD EXPORT

This commit is contained in:
SoulliesOfficial
2025-02-08 23:09:50 -05:00
parent 7ab738cb68
commit e3a8450a27
61 changed files with 1229 additions and 237 deletions

View File

@@ -39,7 +39,7 @@ namespace Ichni.RhythmGame
this.elementName = name;
this.elementGuid = elementGuid;
this.tags = tags;
EditorManager.instance.elementList.Add(this);
EditorManager.instance.beatmapContainer.gameElementList.Add(this);
submoduleList = new List<SubmoduleBase>();
if (isFirstGenerated)
{
@@ -123,7 +123,7 @@ namespace Ichni.RhythmGame
#if UNITY_EDITOR
Debug.Log("Delete " + elementName + "(" + elementGuid + ")");
#endif
EditorManager.instance.elementList.Remove(this); //从保存列表中剔除
EditorManager.instance.beatmapContainer.gameElementList.Remove(this); //从保存列表中剔除
this.parentElement.childElementList.Remove(this);
Destroy(gameObject); //销毁
}
@@ -167,20 +167,19 @@ namespace Ichni.RhythmGame
{
return element_BM;
}
Debug.LogAssertion("Element not found or do not have id");
return null;
}
public static GameElement GetElement(Guid id)
{
return GetElementBM(id)?.matchedElement;
if(identifier.TryGetValue(id, out GameElement_BM element_BM))
{
return element_BM.matchedElement;
}
return null;
}
/// <summary>
/// 从存档类中生成游戏物体
/// </summary>
public abstract void ExecuteBM();
/// <summary>
/// 复制物体