49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using Random = UnityEngine.Random;
|
|
|
|
namespace AibisDream.FixSystem
|
|
{
|
|
[CreateAssetMenu(fileName = "WhackMoldData", menuName = AibisAssetMenus.FixWhackMoleData)]
|
|
public class WhackMoleData : ScriptableObject
|
|
{
|
|
[Header("基本参数")]
|
|
public float moleExistTime = 1f;
|
|
public int flickerFreq = 10;
|
|
public Vector2 batchDuration = new(2f, 3f);
|
|
public int totalBatchNum = 5;
|
|
|
|
[Header("批次序列")]
|
|
public WhackMoleBatch[] batches;
|
|
|
|
[Header("流水线数据")]
|
|
[Tooltip("置空则停止流水线游戏")]
|
|
public CheckRule[] checkRules;
|
|
public CheckData[] checkDatas;
|
|
|
|
[Header("是否加入验证码")]
|
|
public bool isAddVerifyCode;
|
|
|
|
public WhackMoleBatch GetBatch(int index)
|
|
{
|
|
return index >= batches.Length ? batches[^1] : batches[index];
|
|
}
|
|
|
|
public float GetBatchGap()
|
|
{
|
|
return Random.Range(batchDuration.x, batchDuration.y);
|
|
}
|
|
|
|
public bool HasPipeline()
|
|
{
|
|
return checkRules is { Length: > 0 };
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public struct WhackMoleBatch
|
|
{
|
|
public int moleNum;
|
|
public Vector2 durationRange;
|
|
}
|
|
} |