2023-08-22 19:08:45 +08:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
2024-06-04 16:50:16 +08:00
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Runtime.Serialization;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
namespace Gameplay.Level
|
|
|
|
|
{
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class LevelData
|
|
|
|
|
{
|
|
|
|
|
[Serializable]
|
2025-05-28 15:55:33 +08:00
|
|
|
public class Task
|
2023-08-22 19:08:45 +08:00
|
|
|
{
|
2025-05-28 15:55:33 +08:00
|
|
|
[LabelText("任务ID")] public int taskId;
|
|
|
|
|
[LabelText("任务名称")] public string taskNameKey;
|
|
|
|
|
[LabelText("任务描述")] public string taskDescKey;
|
|
|
|
|
|
|
|
|
|
[LabelText("任务目标")] [ListDrawerSettings(CustomAddFunction = "OnAddCondition")]
|
|
|
|
|
public List<ConditionModifier> taskConditions = new();
|
|
|
|
|
|
|
|
|
|
[LabelText("前置任务ID")] public int preTaskId = -1;
|
|
|
|
|
[LabelText("后置任务ID")] public int postTaskId = -1;
|
|
|
|
|
[LabelText("阻拦区域ID")] public int blockRegionId = -1;
|
|
|
|
|
|
|
|
|
|
private void OnAddCondition()
|
|
|
|
|
{
|
|
|
|
|
ConditionModifier conditionModifier = new();
|
2025-05-28 16:24:06 +08:00
|
|
|
conditionModifier.SetFilterTypes(ConditionUtil.AllLevelConditionFilter);
|
2025-05-28 15:55:33 +08:00
|
|
|
taskConditions.Add(conditionModifier);
|
|
|
|
|
}
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2025-05-28 15:55:33 +08:00
|
|
|
[OnDeserialized]
|
|
|
|
|
public void OnAfterDeserialize(StreamingContext context)
|
|
|
|
|
{
|
|
|
|
|
foreach (var conditionModifier in taskConditions)
|
|
|
|
|
{
|
2025-05-28 16:24:06 +08:00
|
|
|
conditionModifier.SetFilterTypes(ConditionUtil.AllLevelConditionFilter);
|
2025-05-28 15:55:33 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class Stage
|
|
|
|
|
{
|
|
|
|
|
// TODO 舍弃
|
|
|
|
|
[HideInInspector] [LabelText("胜利条件")]
|
2023-11-21 15:04:56 +08:00
|
|
|
public ConditionModifier successCondition = new(ConditionUtil.LevelSuccessConditionFilter);
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2025-05-28 16:24:06 +08:00
|
|
|
// TODO 舍弃
|
2025-05-29 15:45:13 +08:00
|
|
|
[HideInInspector] [LabelText("失败条件")] [ListDrawerSettings(CustomAddFunction = "OnAddFailCondition")]
|
2023-11-06 18:20:55 +08:00
|
|
|
public List<ConditionModifier> failConditions = new();
|
2025-05-29 15:45:13 +08:00
|
|
|
|
2025-05-28 16:24:06 +08:00
|
|
|
[LabelText("胜利目标")] public int successTaskID;
|
2025-05-29 15:45:13 +08:00
|
|
|
|
2025-05-28 16:24:06 +08:00
|
|
|
[LabelText("失败目标")] public int failTaskID;
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2025-05-28 15:55:33 +08:00
|
|
|
[LabelText("任务列表")] [ListDrawerSettings(CustomAddFunction = "OnAddTask")]
|
|
|
|
|
public List<Task> tasks = new();
|
|
|
|
|
|
2023-11-06 18:20:55 +08:00
|
|
|
private void OnAddFailCondition()
|
|
|
|
|
{
|
2023-11-06 19:18:24 +08:00
|
|
|
ConditionModifier conditionModifier = new();
|
|
|
|
|
conditionModifier.SetFilterTypes(ConditionUtil.LevelFailConditionFilter);
|
2023-11-06 18:20:55 +08:00
|
|
|
failConditions.Add(conditionModifier);
|
|
|
|
|
}
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2025-05-28 15:55:33 +08:00
|
|
|
private void OnAddTask()
|
|
|
|
|
{
|
|
|
|
|
var task = new Task
|
|
|
|
|
{
|
|
|
|
|
taskId = tasks.Count + 1 // 任务ID从1开始
|
|
|
|
|
};
|
|
|
|
|
tasks.Add(task);
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-06 19:18:24 +08:00
|
|
|
[OnDeserialized]
|
|
|
|
|
public void OnAfterDeserialize(System.Runtime.Serialization.StreamingContext context)
|
|
|
|
|
{
|
|
|
|
|
successCondition.SetFilterTypes(ConditionUtil.LevelSuccessConditionFilter);
|
|
|
|
|
foreach (var failCondition in failConditions)
|
|
|
|
|
{
|
|
|
|
|
failCondition.SetFilterTypes(ConditionUtil.LevelFailConditionFilter);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
[Serializable]
|
|
|
|
|
public class NPCInfo
|
2024-11-12 20:31:06 +08:00
|
|
|
{
|
2025-06-13 12:49:47 +08:00
|
|
|
[HideInInspector] public int index; // LocalID
|
|
|
|
|
[HideInInspector] public int id; // 怪物ID
|
2025-05-28 15:55:33 +08:00
|
|
|
|
2025-04-07 14:34:27 +08:00
|
|
|
// 仅供展示
|
2024-11-12 20:31:06 +08:00
|
|
|
[ReadOnly] public int level;
|
|
|
|
|
[ReadOnly] [LabelText("位置")] public Vector2Int position;
|
|
|
|
|
[LabelText("初始护盾")] public float shield;
|
|
|
|
|
[LabelText("初始血量")] public float ph;
|
|
|
|
|
[LabelText("初始士气")] public float morale;
|
|
|
|
|
[LabelText("Buff")] public List<int> buff = new List<int>();
|
|
|
|
|
[LabelText("DeBuff")] public List<int> deBuff = new List<int>();
|
2025-06-04 16:59:05 +08:00
|
|
|
[LabelText("AI类型(需舍弃)")] public AIType aIType = AIType.None;
|
|
|
|
|
[LabelText("特殊触发AI(需舍弃)")] public AttachAIType attachAIType;
|
2024-11-12 20:31:06 +08:00
|
|
|
[HideInInspector] public CharacterToward npcToward;
|
|
|
|
|
[LabelText("巡逻信息")] public List<PatrolInfo> patrolInfos = new List<PatrolInfo>(4);
|
2024-07-22 14:46:20 +08:00
|
|
|
[LabelText("编组")] public List<int> groups = new List<int>(4);
|
2024-12-04 18:49:20 +08:00
|
|
|
[LabelText("防守距离")] public int defensiveDistance;
|
2025-02-17 17:11:38 +08:00
|
|
|
[HideInInspector] public string configName;
|
2025-02-24 19:26:18 +08:00
|
|
|
[LabelText("是否为中途生成AI")] public bool isHideOnLoad;
|
2025-05-29 15:45:13 +08:00
|
|
|
[LabelText("所属波数")] public int waveIndex;
|
2025-06-03 14:34:32 +08:00
|
|
|
[LabelText("刷新时间(s)")] public int refreshTime;
|
2025-05-29 15:45:13 +08:00
|
|
|
[LabelText("所属防守区域")] public int defenseRegionIndex;
|
2025-06-04 15:58:48 +08:00
|
|
|
[LabelText("指定路线ID")] public int specifyRoadID = -1;
|
2025-06-05 19:03:31 +08:00
|
|
|
[LabelText("显示路径")] public bool showRoadLine;
|
2025-06-05 15:32:06 +08:00
|
|
|
[LabelText("指定区域ID")] public int specifyRegionID = -1;
|
2023-10-19 15:00:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class PatrolInfo
|
|
|
|
|
{
|
2024-11-12 20:31:06 +08:00
|
|
|
[HorizontalGroup("PatrolInfo")] [LabelText("巡逻点位")]
|
2023-10-19 15:00:19 +08:00
|
|
|
public Vector2Int patrolPoint;
|
2024-11-12 20:31:06 +08:00
|
|
|
|
|
|
|
|
[HorizontalGroup("PatrolInfo")] [LabelText("等待时间")]
|
|
|
|
|
public float waitTime = 0f;
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
2025-05-30 16:28:42 +08:00
|
|
|
|
2025-05-29 15:45:13 +08:00
|
|
|
[Serializable]
|
2025-05-30 16:42:07 +08:00
|
|
|
public class SpawnMonsterData
|
2025-05-29 15:45:13 +08:00
|
|
|
{
|
2025-06-04 14:06:11 +08:00
|
|
|
[LabelText("波次ID")] public int waveIndex;
|
|
|
|
|
|
2025-05-30 16:28:42 +08:00
|
|
|
[LabelText("刷新方式")] public ELevelUnitGenType refreshType = ELevelUnitGenType.Default;
|
2025-05-29 15:45:13 +08:00
|
|
|
|
2025-05-30 16:28:42 +08:00
|
|
|
[LabelText("间隔时间")] [ShowIf("@refreshType==ELevelUnitGenType.TimeLoop")]
|
|
|
|
|
public int refreshInterval;
|
2025-05-29 15:45:13 +08:00
|
|
|
|
2025-06-04 14:06:11 +08:00
|
|
|
[LabelText("最大次数 (-1无限循环), 如果为跳转则表示跳转ID")]
|
2025-05-30 16:28:42 +08:00
|
|
|
public int maxCount;
|
2025-05-29 15:45:13 +08:00
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2025-05-30 16:28:42 +08:00
|
|
|
[Serializable]
|
|
|
|
|
public class LevelTriggerData
|
2025-05-29 15:45:13 +08:00
|
|
|
{
|
2025-05-30 16:28:42 +08:00
|
|
|
[LabelText("触发类型")] public ELevelTriggerType levelTriggerType = ELevelTriggerType.Default;
|
2025-06-04 14:06:11 +08:00
|
|
|
|
2025-05-30 16:28:42 +08:00
|
|
|
[LabelText("参数 (时间/区域ID)")] public int triggerTime = 0;
|
2025-06-04 14:06:11 +08:00
|
|
|
|
2025-06-03 12:16:38 +08:00
|
|
|
[LabelText("刷怪波次")] public int wave;
|
2025-06-05 12:27:48 +08:00
|
|
|
|
|
|
|
|
[LabelText("任务ID")] [ShowIf("@levelTriggerType==ELevelTriggerType.TaskComplete")]
|
|
|
|
|
public int taskID;
|
|
|
|
|
|
|
|
|
|
[LabelText("触发Effect类型")] public ELevelTriggerEffectType effectType = ELevelTriggerEffectType.StartGenUnit;
|
|
|
|
|
|
2025-06-05 16:49:26 +08:00
|
|
|
[LabelText("怪物波次IDs")] [ShowIf("@effectType==ELevelTriggerEffectType.ForceKillUnits")]
|
2025-06-05 12:27:48 +08:00
|
|
|
public List<int> waveList = new List<int>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class PrescribedRoadInfo
|
|
|
|
|
{
|
|
|
|
|
public int roadID;
|
|
|
|
|
public List<int> cellIndex = new List<int>();
|
2025-05-29 15:45:13 +08:00
|
|
|
}
|
|
|
|
|
|
2025-06-05 17:15:49 +08:00
|
|
|
#region LevelGuide
|
|
|
|
|
|
2025-06-06 15:32:28 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 波次横幅显示
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class WaveInfoData
|
|
|
|
|
{
|
|
|
|
|
[ReadOnly] [LabelText("ID")] public int localID;
|
|
|
|
|
[LabelText("触发波次ID")] public int waveID = -1;
|
|
|
|
|
[LabelText("第几次循环")] public int loopCount = 1;
|
|
|
|
|
[LabelText("是否显示横幅")] public bool showWaveInfo;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-05 17:15:49 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 关卡进度引导
|
|
|
|
|
/// </summary>
|
2025-06-05 16:49:26 +08:00
|
|
|
[Serializable]
|
2025-06-05 17:15:49 +08:00
|
|
|
public class ProgressGuideData
|
2025-06-05 16:49:26 +08:00
|
|
|
{
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("关卡进度参数:类型")] public ELevelGuideProgressType progressType;
|
2025-06-06 12:22:56 +08:00
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("触发条件")] public ConditionModifier triggerCondition;
|
2025-06-05 16:49:26 +08:00
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("完成条件")] public ConditionModifier finishCondition;
|
2025-06-05 16:49:26 +08:00
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
public ProgressGuideData(ProgressGuideData data)
|
|
|
|
|
{
|
|
|
|
|
progressType = data.progressType;
|
|
|
|
|
triggerCondition = data.triggerCondition;
|
|
|
|
|
finishCondition = data.finishCondition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProgressGuideData()
|
|
|
|
|
{
|
|
|
|
|
progressType = ELevelGuideProgressType.SuccessProgress;
|
|
|
|
|
triggerCondition = new ConditionModifier(ConditionUtil.LevelGuideConditionFilter);
|
|
|
|
|
finishCondition = new ConditionModifier(ConditionUtil.LevelGuideEndConditionFilter);
|
|
|
|
|
}
|
2025-06-11 16:44:27 +08:00
|
|
|
|
|
|
|
|
[OnDeserialized]
|
|
|
|
|
public void OnAfterDeserialize(StreamingContext context)
|
|
|
|
|
{
|
|
|
|
|
triggerCondition.SetFilterTypes(ConditionUtil.LevelGuideConditionFilter);
|
2025-06-11 20:01:49 +08:00
|
|
|
finishCondition.SetFilterTypes(ConditionUtil.LevelGuideEndConditionFilter);
|
2025-06-11 16:44:27 +08:00
|
|
|
}
|
2025-06-05 17:15:49 +08:00
|
|
|
}
|
2025-06-05 16:49:26 +08:00
|
|
|
|
2025-06-05 17:15:49 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 关卡立标引导
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class SetFlagGuideData
|
|
|
|
|
{
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("立标类型")] public ELevelGuideSetFlagType setFlagType;
|
2025-06-05 17:03:22 +08:00
|
|
|
|
2025-06-06 14:02:38 +08:00
|
|
|
[LabelText("选择单位类型")] [ShowIf("@setFlagType==ELevelGuideSetFlagType.Unit")]
|
2025-06-11 13:31:37 +08:00
|
|
|
public ESetFlagUnitType unitType;
|
2025-06-06 14:02:38 +08:00
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("对应ID")] public int setFlagID;
|
2025-06-06 16:31:16 +08:00
|
|
|
|
2025-06-12 12:41:07 +08:00
|
|
|
[HorizontalGroup("1")][LabelText("立标提示内容")] public string setFlagKey;
|
|
|
|
|
[HorizontalGroup("1")][LabelText("备注")] public string note; // 策划使用备注
|
2025-06-05 17:03:22 +08:00
|
|
|
|
2025-06-10 18:45:59 +08:00
|
|
|
[HideInInspector] [LabelText("立标配置ID")]
|
|
|
|
|
public int guideTagID; // 编辑器使用
|
|
|
|
|
|
|
|
|
|
[HideInInspector] [LabelText("立标路径")] public string guideTagPath;
|
|
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("触发条件")] public ConditionModifier triggerCondition;
|
|
|
|
|
|
|
|
|
|
[LabelText("完成条件")] public ConditionModifier finishCondition;
|
|
|
|
|
|
|
|
|
|
public SetFlagGuideData(SetFlagGuideData data)
|
|
|
|
|
{
|
|
|
|
|
setFlagType = data.setFlagType;
|
|
|
|
|
unitType = data.unitType;
|
|
|
|
|
setFlagID = data.setFlagID;
|
|
|
|
|
setFlagKey = data.setFlagKey;
|
|
|
|
|
guideTagID = data.guideTagID;
|
|
|
|
|
guideTagPath = data.guideTagPath;
|
|
|
|
|
triggerCondition = data.triggerCondition;
|
|
|
|
|
finishCondition = data.finishCondition;
|
|
|
|
|
}
|
2025-06-05 16:49:26 +08:00
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
public SetFlagGuideData()
|
|
|
|
|
{
|
|
|
|
|
setFlagType = ELevelGuideSetFlagType.CellIndex;
|
|
|
|
|
unitType = ESetFlagUnitType.Self;
|
|
|
|
|
setFlagID = -1;
|
|
|
|
|
triggerCondition = new ConditionModifier(ConditionUtil.LevelGuideConditionFilter);
|
|
|
|
|
finishCondition = new ConditionModifier(ConditionUtil.LevelGuideEndConditionFilter);
|
|
|
|
|
}
|
2025-06-11 16:44:27 +08:00
|
|
|
|
|
|
|
|
[OnDeserialized]
|
|
|
|
|
public void OnAfterDeserialize(StreamingContext context)
|
|
|
|
|
{
|
|
|
|
|
triggerCondition.SetFilterTypes(ConditionUtil.LevelGuideConditionFilter);
|
2025-06-11 20:01:49 +08:00
|
|
|
finishCondition.SetFilterTypes(ConditionUtil.LevelGuideEndConditionFilter);
|
2025-06-11 16:44:27 +08:00
|
|
|
}
|
2025-06-05 16:49:26 +08:00
|
|
|
}
|
|
|
|
|
|
2025-06-05 17:15:49 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 关卡信息面板引导
|
|
|
|
|
/// </summary>
|
2025-06-05 17:03:22 +08:00
|
|
|
[Serializable]
|
2025-06-05 17:15:49 +08:00
|
|
|
public class InfoPanelGuideData
|
2025-06-05 17:03:22 +08:00
|
|
|
{
|
2025-06-12 12:41:07 +08:00
|
|
|
[HorizontalGroup("1")][LabelText("标题ID")] public string titleKey;
|
|
|
|
|
[HorizontalGroup("1")][LabelText("备注")] public string noteTitle; // 策划使用备注
|
|
|
|
|
[HorizontalGroup("2")][LabelText("内容ID")] public string contentKey;
|
|
|
|
|
[HorizontalGroup("2")][LabelText("备注")] public string noteContent; // 策划使用备注
|
|
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("触发条件")] public ConditionModifier triggerCondition;
|
2025-06-05 17:15:49 +08:00
|
|
|
|
2025-06-11 13:31:37 +08:00
|
|
|
[LabelText("完成条件")] public ConditionModifier finishCondition;
|
|
|
|
|
|
|
|
|
|
public InfoPanelGuideData(InfoPanelGuideData data)
|
|
|
|
|
{
|
|
|
|
|
titleKey = data.titleKey;
|
|
|
|
|
contentKey = data.contentKey;
|
|
|
|
|
triggerCondition = data.triggerCondition;
|
|
|
|
|
finishCondition = data.finishCondition;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InfoPanelGuideData()
|
|
|
|
|
{
|
|
|
|
|
triggerCondition = new ConditionModifier(ConditionUtil.LevelGuideConditionFilter);
|
|
|
|
|
finishCondition = new ConditionModifier(ConditionUtil.LevelGuideEndConditionFilter);
|
|
|
|
|
}
|
2025-06-11 16:44:27 +08:00
|
|
|
|
|
|
|
|
[OnDeserialized]
|
|
|
|
|
public void OnAfterDeserialize(StreamingContext context)
|
|
|
|
|
{
|
|
|
|
|
triggerCondition.SetFilterTypes(ConditionUtil.LevelGuideConditionFilter);
|
2025-06-11 20:01:49 +08:00
|
|
|
finishCondition.SetFilterTypes(ConditionUtil.LevelGuideEndConditionFilter);
|
2025-06-11 16:44:27 +08:00
|
|
|
}
|
2025-06-05 17:03:22 +08:00
|
|
|
}
|
|
|
|
|
|
2025-06-05 17:15:49 +08:00
|
|
|
#endregion
|
2025-06-05 19:03:31 +08:00
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
public enum CharacterToward
|
|
|
|
|
{
|
|
|
|
|
TopLeft,
|
|
|
|
|
TopRight,
|
|
|
|
|
Right,
|
|
|
|
|
BottomRight,
|
|
|
|
|
BottomLeft,
|
|
|
|
|
Left,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum AIType
|
|
|
|
|
{
|
|
|
|
|
BasicAI,
|
|
|
|
|
FallBackAI,
|
2023-10-19 15:00:19 +08:00
|
|
|
FallBackIntensifyAI,
|
2023-08-22 19:08:45 +08:00
|
|
|
OutflankAI,
|
2024-12-04 18:49:20 +08:00
|
|
|
DefendAI,
|
2025-02-21 17:03:56 +08:00
|
|
|
StupidDefendAI,
|
2024-11-12 20:31:06 +08:00
|
|
|
None,
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum AttachAIType
|
|
|
|
|
{
|
|
|
|
|
None,
|
|
|
|
|
ChainAI,
|
|
|
|
|
ProvokeAI,
|
|
|
|
|
SpecialBehaviorAI,
|
2024-12-05 16:05:12 +08:00
|
|
|
AttackProtectUnitAI,
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
|
2023-11-21 15:04:56 +08:00
|
|
|
public LevelData()
|
|
|
|
|
{
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
|
2024-11-12 20:31:06 +08:00
|
|
|
[LabelText("出战区")] [HideInInspector] public int preparingRegionId;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2024-11-12 20:31:06 +08:00
|
|
|
[LabelText("出战区朝向")] [HideInInspector] public CharacterToward preparingRegionToward;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2024-11-12 20:31:06 +08:00
|
|
|
[LabelText("撤退区")] [HideInInspector] public int fallbackRegionId;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2024-11-12 20:31:06 +08:00
|
|
|
[LabelText("敌方撤退区")] [HideInInspector] public int enemyFallbackRegionId;
|
|
|
|
|
|
|
|
|
|
[LabelText("PVP防守区")] [HideInInspector]
|
2023-12-26 18:19:05 +08:00
|
|
|
public int pvpDefendRegionId;
|
|
|
|
|
|
2024-11-12 20:31:06 +08:00
|
|
|
[LabelText("PVP防守方朝向")] [HideInInspector]
|
2023-12-26 18:19:05 +08:00
|
|
|
public CharacterToward pvpDefendToward;
|
2025-06-10 18:45:59 +08:00
|
|
|
|
2025-06-06 18:17:42 +08:00
|
|
|
// TODO 删除
|
2025-06-10 18:45:59 +08:00
|
|
|
[HideInInspector] [BoxGroup("主线")] [LabelText("关卡任务")]
|
|
|
|
|
public Stage stage;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2025-05-29 15:45:13 +08:00
|
|
|
[BoxGroup("支线")] [LabelText("设置该关卡为评分关卡")]
|
|
|
|
|
public bool scoreLevel = false;
|
2024-08-27 14:18:39 +08:00
|
|
|
|
2025-05-28 17:49:04 +08:00
|
|
|
[BoxGroup("支线")]
|
2025-05-29 15:45:13 +08:00
|
|
|
[LabelText("星级目标"), HideIf("scoreLevel")]
|
|
|
|
|
[ListDrawerSettings(HideAddButton = true, HideRemoveButton = true)]
|
2024-06-04 12:59:37 +08:00
|
|
|
public List<ConditionModifier> starTarget = new()
|
|
|
|
|
{
|
|
|
|
|
new ConditionModifier(ConditionUtil.LevelStarConditionFilter),
|
|
|
|
|
new ConditionModifier(ConditionUtil.LevelStarConditionFilter),
|
|
|
|
|
new ConditionModifier(ConditionUtil.LevelStarConditionFilter)
|
|
|
|
|
};
|
2024-08-27 14:18:39 +08:00
|
|
|
|
2025-05-29 15:45:13 +08:00
|
|
|
[BoxGroup("支线")]
|
|
|
|
|
[LabelText("评分目标"), ShowIf("scoreLevel")]
|
|
|
|
|
[ListDrawerSettings(CustomAddFunction = "OnAddScoreCondition")]
|
2024-08-27 14:18:39 +08:00
|
|
|
public List<ConditionModifier> scoreTarget = new List<ConditionModifier>(15);
|
|
|
|
|
|
|
|
|
|
private void OnAddScoreCondition()
|
|
|
|
|
{
|
|
|
|
|
ConditionModifier conditionModifier = new();
|
|
|
|
|
conditionModifier.SetFilterTypes(ConditionUtil.LevelScoreConditionFilter, true);
|
|
|
|
|
scoreTarget.Add(conditionModifier);
|
|
|
|
|
}
|
2024-06-04 16:50:16 +08:00
|
|
|
|
2025-05-30 16:28:42 +08:00
|
|
|
[BoxGroup("防守相关设置")] [LabelText("防守关卡数据")]
|
2025-05-30 16:42:07 +08:00
|
|
|
public List<SpawnMonsterData> spawnMonsterDatas;
|
2025-05-29 15:45:13 +08:00
|
|
|
|
2025-06-06 15:32:28 +08:00
|
|
|
[BoxGroup("防守相关设置")] [LabelText("波次横幅显示数据")] [ListDrawerSettings(CustomAddFunction = "OnAddWaveInfoData")]
|
|
|
|
|
public List<WaveInfoData> waveInfoDatas = new();
|
|
|
|
|
|
|
|
|
|
private void OnAddWaveInfoData()
|
|
|
|
|
{
|
|
|
|
|
var waveInfoData = new WaveInfoData
|
|
|
|
|
{
|
|
|
|
|
localID = waveInfoDatas.Count + 1
|
|
|
|
|
};
|
|
|
|
|
waveInfoDatas.Add(waveInfoData);
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-05 12:27:48 +08:00
|
|
|
[BoxGroup("触发器")] [LabelText("关卡触发器")] public List<LevelTriggerData> levelTriggerDatas;
|
2025-06-04 14:06:11 +08:00
|
|
|
|
2025-06-04 13:44:18 +08:00
|
|
|
[BoxGroup("特殊需求")] [LabelText("初始生命百分值")]
|
|
|
|
|
public float initialHealthPercent = 1.0f;
|
2025-05-29 15:45:13 +08:00
|
|
|
|
2025-06-04 14:06:11 +08:00
|
|
|
[BoxGroup("特殊需求")] [LabelText("初始护盾百分值")]
|
|
|
|
|
public float initialShieldPercent = 1.0f;
|
2025-06-06 14:02:38 +08:00
|
|
|
|
2025-06-06 13:27:32 +08:00
|
|
|
#region 关卡引导
|
2025-06-05 17:03:22 +08:00
|
|
|
|
2025-06-10 18:45:59 +08:00
|
|
|
[HideInInspector] [LabelText("关卡进度")] public List<ProgressGuideData> progressGuideDatas = new();
|
2025-06-06 13:27:32 +08:00
|
|
|
|
2025-06-10 18:45:59 +08:00
|
|
|
[HideInInspector] [LabelText("立标数据")] public List<SetFlagGuideData> setFlagGuideDatas = new();
|
2025-06-06 13:27:32 +08:00
|
|
|
|
2025-06-10 18:45:59 +08:00
|
|
|
[HideInInspector] [LabelText("信息板数据")] public List<InfoPanelGuideData> infoPanelGuideDatas = new();
|
2025-06-06 13:27:32 +08:00
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2025-02-21 17:03:56 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 刷新生成点位
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HideInInspector] public List<int> refreshPoints = new List<int>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 指定路线
|
|
|
|
|
/// </summary>
|
2025-06-04 15:58:48 +08:00
|
|
|
[HideInInspector] public List<PrescribedRoadInfo> roadInfos = new List<PrescribedRoadInfo>(4);
|
2025-02-21 17:03:56 +08:00
|
|
|
|
2025-05-29 15:45:13 +08:00
|
|
|
[HideInInspector] public List<NPCInfo> npcInfos = new();
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2025-05-29 15:45:13 +08:00
|
|
|
[HideInInspector] public List<NPCInfo> selfNpcInfos = new();
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2025-06-11 12:02:40 +08:00
|
|
|
[HideInInspector] public Dictionary<int, List<int>> npcGroupInfos = new();
|
|
|
|
|
|
2024-11-25 13:39:03 +08:00
|
|
|
[Serializable]
|
2024-11-07 17:22:30 +08:00
|
|
|
public class CaptureInfo
|
|
|
|
|
{
|
2024-11-12 20:31:06 +08:00
|
|
|
[LabelText("占领点位")] public int CapturePoint;
|
|
|
|
|
[LabelText("占领时间")] public int CaptureProgress = 0;
|
2024-11-07 17:22:30 +08:00
|
|
|
}
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2024-11-07 17:22:30 +08:00
|
|
|
[HideInInspector] public List<CaptureInfo> CapturePoints = new(8);
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2024-11-07 15:05:36 +08:00
|
|
|
[HideInInspector] public List<int> flagStartPoints = new List<int>();
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2024-11-07 17:22:30 +08:00
|
|
|
[HideInInspector] public List<int> flagEndPoints = new List<int>();
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2024-11-11 13:46:47 +08:00
|
|
|
[HideInInspector] public List<int> fallbackSinglePoints = new List<int>();
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2024-11-11 13:46:47 +08:00
|
|
|
[HideInInspector] public List<int> fallbackReusablePoints = new List<int>();
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2024-11-26 16:58:42 +08:00
|
|
|
[HideInInspector] public int fallBackCount;
|
|
|
|
|
|
2023-11-08 15:05:19 +08:00
|
|
|
[OnDeserialized]
|
|
|
|
|
public void OnAfterDeserialize(StreamingContext context)
|
|
|
|
|
{
|
2023-11-21 15:04:56 +08:00
|
|
|
if (starTarget.Count != 3)
|
|
|
|
|
{
|
|
|
|
|
starTarget.Clear();
|
|
|
|
|
starTarget.Add(new ConditionModifier());
|
|
|
|
|
starTarget.Add(new ConditionModifier());
|
|
|
|
|
starTarget.Add(new ConditionModifier());
|
|
|
|
|
}
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2023-11-08 15:05:19 +08:00
|
|
|
foreach (var starCondition in starTarget)
|
|
|
|
|
{
|
|
|
|
|
starCondition.SetFilterTypes(ConditionUtil.LevelStarConditionFilter);
|
|
|
|
|
}
|
2024-11-12 20:31:06 +08:00
|
|
|
|
2024-11-01 18:33:42 +08:00
|
|
|
foreach (var scoreCondition in scoreTarget)
|
|
|
|
|
{
|
|
|
|
|
scoreCondition.SetFilterTypes(ConditionUtil.LevelScoreConditionFilter, scoreLevel);
|
|
|
|
|
}
|
2023-11-08 15:05:19 +08:00
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
}
|