This commit is contained in:
2025-06-01 15:36:20 +08:00
parent 9d92c7c944
commit df7abdb320
18 changed files with 21599 additions and 19177 deletions

View File

@@ -14,8 +14,8 @@ namespace Ichni.RhythmGame
public partial class EffectSubmodule : SubmoduleBase
{
public Dictionary<string, List<EffectBase>> effectCollection;
public EffectSubmodule(GameElement attachedGameElement, EffectSubmodulePreset preset = EffectSubmodulePreset.Default)
public EffectSubmodule(GameElement attachedGameElement, EffectSubmodulePreset preset = EffectSubmodulePreset.Default)
: base(attachedGameElement)
{
effectCollection = new Dictionary<string, List<EffectBase>>();
@@ -87,7 +87,7 @@ namespace Ichni.RhythmGame
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
Inspector inspectorMain = EditorManager.instance.uiManager.inspector;
foreach (var effect in effectCollection)
{
var container = inspector.GenerateContainer(effect.Key);
@@ -102,10 +102,10 @@ namespace Ichni.RhythmGame
}
else
{
LogWindow.Log("Effect Type not found.", Color.red);
LogWindow.Log("Effect Type not found.", Color.yellow);
}
});
foreach (var effectBase in effect.Value)
{
effectBase.SetUpInspector();
@@ -150,17 +150,17 @@ namespace Ichni.RhythmGame
public class EffectSubmodule_BM : Submodule_BM
{
public Dictionary<string, List<EffectBase_BM>> effectCollection;
public EffectSubmodule_BM()
{
}
public EffectSubmodule_BM(GameElement attachedElement) : base(attachedElement)
{
effectCollection = new Dictionary<string, List<EffectBase_BM>>();
IHaveEffectSubmodule element = attachedElement as IHaveEffectSubmodule;
foreach (var effect in element.effectSubmodule.effectCollection)
{
List<EffectBase_BM> effectList = new List<EffectBase_BM>();
@@ -177,7 +177,7 @@ namespace Ichni.RhythmGame
attachedElement = GameElement_BM.GetElement(attachedElementGuid);
(attachedElement as IHaveEffectSubmodule).effectSubmodule = new EffectSubmodule(attachedElement, effectCollection);
}
public override void DuplicateBM(GameElement attached)
{
(attached as IHaveEffectSubmodule).effectSubmodule = new EffectSubmodule(attached, effectCollection);
@@ -194,14 +194,14 @@ namespace Ichni.RhythmGame
After = 1,
Error = 100
}
public BaseElement_BM matchedBM { get; set; }
/// <summary>
/// 效果的持续时间如果为0则表示瞬间效果
/// </summary>
public float effectTime;
/// <summary>
/// 是否是瞬间效果
/// </summary>
@@ -211,7 +211,7 @@ namespace Ichni.RhythmGame
/// 效果的进度百分比
/// </summary>
public float effectProgressPercent;
/// <summary>
/// 效果当前的状态
/// </summary>
@@ -230,7 +230,7 @@ namespace Ichni.RhythmGame
this.nowEffectState = EffectState.Before;
this.effectProgressPercent = 0;
}
public void SaveBM()
{
throw new System.NotImplementedException();
@@ -240,7 +240,7 @@ namespace Ichni.RhythmGame
{
EffectState state = CheckEffectState(triggerTime);
float songTime = EditorManager.instance.songInformation.songTime;
if (state == EffectState.Before && nowEffectState != EffectState.Before)
{
nowEffectState = EffectState.Before;
@@ -253,7 +253,7 @@ namespace Ichni.RhythmGame
{
PreExecute();
}
nowEffectState = EffectState.Middle;
effectProgressPercent = (songTime - triggerTime) / effectTime;
Execute();
@@ -288,21 +288,21 @@ namespace Ichni.RhythmGame
return EffectState.Error;
}
/// <summary>
/// 当从Before状态进入Middle状态时仅在效果的开始时触发一次方法
/// </summary>
public virtual void PreExecute()
{
}
/// <summary>
/// 在效果的持续时间内,触发这个方法
/// </summary>
public virtual void Execute()
{
}
/// <summary>
@@ -311,7 +311,7 @@ namespace Ichni.RhythmGame
/// </summary>
public virtual void Adjust()
{
}
/// <summary>
@@ -319,7 +319,7 @@ namespace Ichni.RhythmGame
/// </summary>
public virtual void Recover()
{
}
/// <summary>
@@ -330,7 +330,7 @@ namespace Ichni.RhythmGame
public void Refresh()
{
}
public abstract void SetUpInspector();
@@ -341,17 +341,17 @@ namespace Ichni.RhythmGame
public abstract class EffectBase_BM
{
public float effectTime;
public EffectBase_BM()
{
}
public EffectBase_BM(float effectTime)
{
this.effectTime = effectTime;
}
/// <summary>
/// 转换为游戏类
/// </summary>