using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Ichni.RhythmGame { public class EffectSubmodule : SubmoduleBase { public List effectList; } public abstract class EffectBase { public enum EffectState { Before = -1, Middle = 0, After = 1, Error = 100 } /// /// 效果的持续时间,如果为0则表示瞬间效果 /// public float effectTime; /// /// 是否是瞬间效果 /// public bool isInstantEffect => effectTime <= 0; /// /// 效果当前的状态 /// public EffectState nowEffectState; protected EffectBase() { this.effectTime = 0; this.nowEffectState = EffectState.Before; } protected EffectBase(float effectTime) { this.effectTime = effectTime; this.nowEffectState = EffectState.Before; } /// /// 在效果的持续时间内,触发这个方法 /// public virtual void Execute() { } /// /// 如果是非瞬间效果,在效果完成后,触发这个方法; /// 如果是瞬间效果,则此方法即为Execute。原有的Execute方法不被调用。 /// public virtual void Adjust() { } /// /// 如果时间轴回退到效果的触发时间之前,则触发这个方法 /// public virtual void Recover() { } } }