66 lines
1.7 KiB
C#
66 lines
1.7 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public abstract class SubmoduleBase
|
|
{
|
|
public BaseElement attachedElement;
|
|
|
|
public Submodule_BM matchedBM;
|
|
|
|
public SubmoduleBase(BaseElement attachedElement)
|
|
{
|
|
this.attachedElement = attachedElement;
|
|
}
|
|
|
|
public virtual void InitialRefresh()
|
|
{
|
|
|
|
}
|
|
|
|
public abstract void SaveBM();
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public abstract class Submodule_BM
|
|
{
|
|
[System.NonSerialized] public BaseElement attachedElement; //存档类对应的游戏物体
|
|
public Guid attachedElementGuid;
|
|
|
|
public Submodule_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public Submodule_BM(BaseElement attachedElement)
|
|
{
|
|
this.attachedElement = attachedElement;
|
|
attachedElementGuid = attachedElement.elementGuid;
|
|
}
|
|
|
|
public static BaseElement_BM GetElementBM(Guid id)
|
|
{
|
|
if (BaseElement_BM.identifier.TryGetValue(id, out BaseElement_BM element_BM))
|
|
{
|
|
return element_BM;
|
|
}
|
|
|
|
Debug.LogAssertion("Element not found or do not have id");
|
|
return null;
|
|
}
|
|
|
|
public static BaseElement GetElement(Guid id)
|
|
{
|
|
return GetElementBM(id)?.matchedElement;
|
|
}
|
|
|
|
public abstract void ExecuteBM();
|
|
public abstract void DuplicateBM(BaseElement attached);
|
|
}
|
|
}
|
|
} |