46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public class SetIntegerEffect : EffectBase
|
|
{
|
|
#region [效果参数] Effect Parameters
|
|
public string targetVariableName;
|
|
|
|
public int targetValue;
|
|
|
|
public bool isRandom;
|
|
public int minValue;
|
|
public int maxValue;
|
|
#endregion
|
|
|
|
#region [初始化] Initialization
|
|
public SetIntegerEffect(string targetVariableName, int targetValue, bool isRandom, int minValue, int maxValue)
|
|
{
|
|
this.effectTime = 0;
|
|
this.targetVariableName = targetVariableName;
|
|
this.targetValue = targetValue;
|
|
this.isRandom = isRandom;
|
|
this.minValue = minValue;
|
|
this.maxValue = maxValue;
|
|
}
|
|
#endregion
|
|
|
|
#region [效果逻辑覆盖] Effect Pattern Overrides
|
|
public override void Recover()
|
|
{
|
|
GameManager.Instance.variablesContainer.RevertVariable(targetVariableName);
|
|
}
|
|
|
|
public override void Adjust()
|
|
{
|
|
GameManager.Instance.variablesContainer.SetVariable(targetVariableName, isRandom ? Random.Range(minValue, maxValue + 1) : targetValue);
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
|
|
} |