68 lines
1.8 KiB
C#
68 lines
1.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public abstract class SubmoduleBase : IBaseElement
|
|
{
|
|
public GameElement attachedGameElement;
|
|
|
|
public BaseElement_BM matchedBM { get; set; }
|
|
|
|
public SubmoduleBase(GameElement attachedGameElement)
|
|
{
|
|
this.attachedGameElement = attachedGameElement;
|
|
}
|
|
|
|
public virtual void InitialRefresh()
|
|
{
|
|
|
|
}
|
|
|
|
public abstract void SaveBM();
|
|
|
|
public virtual void OnDelete()
|
|
{
|
|
|
|
}
|
|
|
|
public virtual void Delete()
|
|
{
|
|
attachedGameElement.submoduleList.Remove(this);
|
|
}
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public abstract class Submodule_BM : BaseElement_BM
|
|
{
|
|
[System.NonSerialized] public GameElement attachedElement; //存档类对应的游戏物体
|
|
public Guid attachedElementGuid;
|
|
|
|
public Submodule_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public Submodule_BM(GameElement attachedElement)
|
|
{
|
|
this.attachedElement = attachedElement;
|
|
attachedElementGuid = attachedElement.elementGuid;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 从存档类中生成游戏物体
|
|
/// </summary>
|
|
public abstract void ExecuteBM();
|
|
|
|
/// <summary>
|
|
/// 复制物体
|
|
/// </summary>
|
|
/// <param name="attached">(对于物体)父物体,(对于次级模块)或挂载物体</param>
|
|
public abstract void DuplicateBM(GameElement attached);
|
|
}
|
|
}
|
|
} |