基础内容-10
保存测试
This commit is contained in:
@@ -33,6 +33,7 @@ namespace Ichni.RhythmGame
|
||||
//次级模块
|
||||
public List<SubmoduleBase> submoduleList = new List<SubmoduleBase>();
|
||||
|
||||
|
||||
public TimeDurationSubmodule timeDurationSubmodule;
|
||||
public TransformSubmodule transformSubmodule;
|
||||
public ColorSubmodule colorSubmodule;
|
||||
@@ -47,6 +48,7 @@ namespace Ichni.RhythmGame
|
||||
this.elementGuid = elementGuid;
|
||||
this.tags = tags;
|
||||
EditorManager.instance.elementList.Add(this);
|
||||
submoduleList = new List<SubmoduleBase>();
|
||||
//GameManager.beatMapContainer.beatMapElementList.Add(this);
|
||||
//serialNumber = totalSerialNumber++;
|
||||
//SetTransformObserver();
|
||||
@@ -57,7 +59,9 @@ namespace Ichni.RhythmGame
|
||||
/// </summary>
|
||||
public virtual void AfterInitialize()
|
||||
{
|
||||
|
||||
submoduleList.Add(timeDurationSubmodule);
|
||||
submoduleList.Add(transformSubmodule);
|
||||
submoduleList.Add(colorSubmodule);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -209,9 +213,12 @@ namespace Ichni.RhythmGame
|
||||
[System.Serializable]
|
||||
public abstract class BaseElement_BM
|
||||
{
|
||||
[System.NonSerialized] public static Dictionary<Guid, BaseElement_BM> identifier; //存档类的标识符
|
||||
[System.NonSerialized]
|
||||
public static Dictionary<Guid, BaseElement_BM> identifier = new Dictionary<Guid, BaseElement_BM>(); //存档类的标识符
|
||||
|
||||
[System.NonSerialized]
|
||||
public BaseElement matchedElement; //存档类对应的游戏物体
|
||||
|
||||
[System.NonSerialized] public BaseElement matchedElement; //存档类对应的游戏物体
|
||||
public string elementName;
|
||||
public List<string> tags;
|
||||
public Guid elementGuid;
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.Basic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
@@ -17,6 +18,9 @@ namespace Ichni
|
||||
public BasePrefabsCollection basePrefabs;
|
||||
|
||||
public List<BaseElement> elementList = new List<BaseElement>();
|
||||
|
||||
public List<BaseElement_BM> elementList_BM = new List<BaseElement_BM>();
|
||||
public List<Submodule_BM> submoduleList_BM = new List<Submodule_BM>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -55,6 +59,20 @@ namespace Ichni
|
||||
e.AfterInitialize();
|
||||
e.Refresh();
|
||||
});
|
||||
|
||||
elementList.ForEach(e =>
|
||||
{
|
||||
e.SaveBM();
|
||||
e.submoduleList.RemoveAll(s=>s == null);
|
||||
e.submoduleList.ForEach(s => s.SaveBM());
|
||||
});
|
||||
|
||||
//Save
|
||||
elementList.ForEach(x => elementList_BM.Add(x.matchedBM));
|
||||
elementList.ForEach(x => submoduleList_BM.AddRange(x.submoduleList.ConvertAll(s => s.matchedBM)));
|
||||
ES3.Save<List<Submodule_BM>>("submoduleList", submoduleList_BM);
|
||||
ES3.Save<List<BaseElement_BM>>("elementList", elementList_BM);
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
Reference in New Issue
Block a user