雷达功能编辑器 删除无用数据

main
zhangaotian 2026-06-04 15:42:02 +08:00
parent f34fedefa4
commit f5369890f2
6 changed files with 55 additions and 275 deletions

View File

@ -126,9 +126,6 @@ namespace Gameplay.Level
{
[HideInInspector] public int triggerTaskID;
// TODO 删除
[HideInInspector] [LabelText("触发类型")] public ELevelTriggerType levelTriggerType = ELevelTriggerType.Default;
[LabelText("刷怪波次")] public int wave;
[LabelText("触发Effect类型")] public ELevelTriggerEffectType effectType = ELevelTriggerEffectType.StartGenUnit;
@ -143,6 +140,14 @@ namespace Gameplay.Level
public int damageBuffId = -1; // 触发后给敌方添加的伤害加成buffID默认-1不添加
}
[Serializable]
public class RadarInfo
{
[LabelText("雷达建筑LocalID")] public int localId;
[LabelText("雷达范围(半径圈数)")] public int range;
[LabelText("占领时间")] public float captureTime;
}
#region LevelGuide
/// <summary>
@ -167,12 +172,6 @@ namespace Gameplay.Level
[LabelText("关卡进度参数:类型")] public ELevelGuideProgressType progressType;
// TODO 删除
[LabelText("旧/触发条件")] public ConditionModifier triggerCondition;
// TODO 删除
[LabelText("旧/完成条件")] public ConditionModifier finishCondition;
[HideInInspector] [LabelText("触发条件")] public int triggerTaskID;
[HideInInspector] [LabelText("完成条件")] public int finishTaskID;
@ -182,26 +181,11 @@ namespace Gameplay.Level
progressType = data.progressType;
triggerTaskID = data.triggerTaskID;
finishTaskID = data.finishTaskID;
// TODO 删除
triggerCondition = data.triggerCondition;
finishCondition = data.finishCondition;
}
public ProgressGuideData()
{
progressType = ELevelGuideProgressType.SuccessProgress;
// TODO 删除
triggerCondition = new ConditionModifier(ConditionUtil.GetAllConditionFilter());
finishCondition = new ConditionModifier(ConditionUtil.GetAllConditionFilter());
}
// TODO 删除
[OnDeserialized]
public void OnAfterDeserialize(StreamingContext context)
{
triggerCondition.SetFilterTypes(ConditionUtil.GetAllConditionFilter());
finishCondition.SetFilterTypes(ConditionUtil.GetAllConditionFilter());
}
}
@ -231,12 +215,6 @@ namespace Gameplay.Level
[HideInInspector] [LabelText("立标路径")] public string guideTagPath;
// TODO 删除
[LabelText("旧/触发条件")] public ConditionModifier triggerCondition;
// TODO 删除
[LabelText("旧/完成条件")] public ConditionModifier finishCondition;
[HideInInspector] [LabelText("触发条件")] public int triggerTaskID;
[HideInInspector] [LabelText("完成条件")] public int finishTaskID;
@ -251,27 +229,13 @@ namespace Gameplay.Level
guideTagPath = data.guideTagPath;
triggerTaskID = data.triggerTaskID;
finishTaskID = data.finishTaskID;
// TODO 删除
triggerCondition = data.triggerCondition;
finishCondition = data.finishCondition;
}
public SetFlagGuideData()
{
setFlagType = ELevelGuideSetFlagType.CellIndex;
unitType = ESetFlagUnitType.Self;
setFlagID = -1; // TODO 删除
triggerCondition = new ConditionModifier(ConditionUtil.GetAllConditionFilter());
finishCondition = new ConditionModifier(ConditionUtil.GetAllConditionFilter());
}
// TODO 删除
[OnDeserialized]
public void OnAfterDeserialize(StreamingContext context)
{
triggerCondition.SetFilterTypes(ConditionUtil.GetAllConditionFilter());
finishCondition.SetFilterTypes(ConditionUtil.GetAllConditionFilter());
setFlagID = -1;
}
}
@ -295,12 +259,6 @@ namespace Gameplay.Level
[HorizontalGroup("2")] [LabelText("备注")]
public string noteContent; // 策划使用备注
// TODO 删除
[LabelText("旧/触发条件")] public ConditionModifier triggerCondition;
// TODO 删除
[LabelText("旧/完成条件")] public ConditionModifier finishCondition;
[HideInInspector] [LabelText("触发条件")] public int triggerTaskID;
[HideInInspector] [LabelText("完成条件")] public int finishTaskID;
@ -311,26 +269,12 @@ namespace Gameplay.Level
contentKey = data.contentKey;
triggerTaskID = data.triggerTaskID;
finishTaskID = data.finishTaskID;
// TODO 删除
triggerCondition = data.triggerCondition;
finishCondition = data.finishCondition;
}
public InfoPanelGuideData()
{
// TODO 删除
triggerCondition = new ConditionModifier(ConditionUtil.GetAllConditionFilter());
finishCondition = new ConditionModifier(ConditionUtil.GetAllConditionFilter());
}
// TODO 删除
[OnDeserialized]
public void OnAfterDeserialize(StreamingContext context)
{
triggerCondition.SetFilterTypes(ConditionUtil.GetAllConditionFilter());
finishCondition.SetFilterTypes(ConditionUtil.GetAllConditionFilter());
}
}
#endregion
@ -387,9 +331,6 @@ namespace Gameplay.Level
[Serializable]
public sealed class AIBroadcastData
{
// TODO 删除
[HideInInspector] [LabelText("触发条件")] public ConditionModifier triggerCondition;
[HideInInspector] [LabelText("触发条件")] public int triggerTaskID;
[LabelText("AI广播对象类型")] public E_AIBroadcastTargetType aiBroadcastTargetType;
@ -454,12 +395,6 @@ namespace Gameplay.Level
public bool isLimitDistance;
#endregion
public AIBroadcastData()
{
// TODO 删除
triggerCondition = new ConditionModifier();
}
}
#endregion
@ -558,7 +493,6 @@ namespace Gameplay.Level
[HideInInspector] public List<int> scoreTaskID = new(15);
// TODO 删除
[HideInInspector] public List<ConditionModifier> scoreTarget = new(15);
#endregion
@ -618,7 +552,6 @@ namespace Gameplay.Level
[HideInInspector] public List<CaptureInfo> CapturePoints = new(8);
[HideInInspector] public List<int> enemyRetreatReusablePoints = new List<int>();
[HideInInspector] public RetreatInfo retreatPoints = new RetreatInfo();
@ -661,16 +594,11 @@ namespace Gameplay.Level
/// 防守区
/// </summary>
[HideInInspector] public List<Region> defenseRegions = new();
/// <summary>
/// 扛旗起点
/// 雷达信息
/// </summary>
[HideInInspector] public List<int> flagStartPoints = new List<int>();
/// <summary>
/// 扛旗终点
/// </summary>
[HideInInspector] public List<int> flagEndPoints = new List<int>();
[HideInInspector] public List<RadarInfo> radarInfos = new List<RadarInfo>();
#endregion

View File

@ -1472,6 +1472,22 @@ public partial class LevelEditorWindow
#endregion
#region 雷达信息
[Serializable]
public class RadarEditorInfo
{
[HideLabel]public RadarInfo radarInfo;
public RadarEditorInfo(RadarInfo radarInfo)
{
this.radarInfo = radarInfo;
}
}
#endregion
#endregion
#region 指定路线

View File

@ -672,20 +672,6 @@ public partial class LevelEditorWindow
// 加载关卡任务
taskInfos = currentLevelData.taskInfos.Select(t => new TaskInfoEditor(t)).ToList();
// 加载胜利失败星级条件
/*successTaskID = currentLevelData.successTaskID;
failTaskID = currentLevelData.failTaskID;
starTaskIDs[0] = currentLevelData.starTaskIDs[0];
starTaskIDs[1] = currentLevelData.starTaskIDs[1];
starTaskIDs[2] = currentLevelData.starTaskIDs[2];
successTask = GetTaskName(currentLevelData.successTaskID);
failTask = GetTaskName(currentLevelData.failTaskID);
oneStarTask = GetTaskName(currentLevelData.starTaskIDs[0]);
twoStarTask = GetTaskName(currentLevelData.starTaskIDs[1]);
threeStarTask = GetTaskName(currentLevelData.starTaskIDs[2]);*/
// 加载评分条件
scoreTasks = currentLevelData.scoreTaskID.Select(s => new ScoreTaskEditor(s)).ToList();
@ -700,8 +686,7 @@ public partial class LevelEditorWindow
pvpDefendRegionId = currentLevelData.pvpDefendRegionId,
pvpDefendToward = currentLevelData.pvpDefendToward
};
// 加载占领数据
captureEditorInfos.Clear();
foreach (var captureInfo in currentLevelData.CapturePoints)
@ -780,6 +765,9 @@ public partial class LevelEditorWindow
// 加载关卡广播
listAIBroadcastData = currentLevelData.listAIBroadcastData.Select(a => new AIBroadcastDataEditor(a)).ToList();
// 加载雷信息
radarInfoList = currentLevelData.radarInfos.Select(r => new RadarEditorInfo(r)).ToList();
// 加载当前关卡的Monster配置
LoadAllNpcConfig();

View File

@ -82,77 +82,7 @@ public partial class LevelEditorWindow : OdinEditorWindow
public List<TaskInfoEditor> taskInfos = new List<TaskInfoEditor>();
#endregion
/*#region 胜利失败星级条件
private int successTaskID;
[FoldoutGroup("胜利失败星级条件")]
[HorizontalGroup("胜利失败星级条件/1")]
[LabelText("胜利条件"), Indent]
[ReadOnly]
[InfoBox("胜利条件任务无效,请在任务列表中检查配置。", InfoMessageType.Error, "@!IsTaskInvalid(successTaskID)")]
public string successTask;
[FoldoutGroup("胜利失败星级条件")]
[HorizontalGroup("胜利失败星级条件/1")]
[Button("搜索/选择胜利任务", ButtonSizes.Small)]
[InfoBox("胜利条件任务无效,请在任务列表中检查配置。", InfoMessageType.Error, "@!IsTaskInvalid(successTaskID)")]
private void OpenSuccessTaskSelector()
{
ShowTaskSelector("选择胜利条件任务", taskName => successTask = taskName, id => successTaskID = id);
}
private int failTaskID;
[FoldoutGroup("胜利失败星级条件")] [HorizontalGroup("胜利失败星级条件/2")] [LabelText("失败条件"), Indent] [ReadOnly]
public string failTask;
[FoldoutGroup("胜利失败星级条件")]
[HorizontalGroup("胜利失败星级条件/2")]
[Button("搜索/选择失败任务", ButtonSizes.Small)]
private void OpenFailTaskSelector()
{
ShowTaskSelector("选择失败条件任务", taskName => failTask = taskName, id => failTaskID = id);
}
private List<int> starTaskIDs = new List<int>() { 0, 0, 0 };
[FoldoutGroup("胜利失败星级条件")] [HorizontalGroup("胜利失败星级条件/3")] [LabelText("1星条件"), Indent] [ReadOnly]
public string oneStarTask;
[FoldoutGroup("胜利失败星级条件")]
[HorizontalGroup("胜利失败星级条件/3")]
[Button("搜索/选择1星任务", ButtonSizes.Small)]
private void OpenOneStarTaskSelector()
{
ShowTaskSelector("选择1星条件任务", taskName => oneStarTask = taskName, id => starTaskIDs[0] = id);
}
[FoldoutGroup("胜利失败星级条件")] [HorizontalGroup("胜利失败星级条件/4")] [LabelText("2星条件"), Indent] [ReadOnly]
public string twoStarTask;
[FoldoutGroup("胜利失败星级条件")]
[HorizontalGroup("胜利失败星级条件/4")]
[Button("搜索/选择2星任务", ButtonSizes.Small)]
private void OpenTwoStarTaskSelector()
{
ShowTaskSelector("选择2星条件任务", taskName => twoStarTask = taskName, id => starTaskIDs[1] = id);
}
[FoldoutGroup("胜利失败星级条件")] [HorizontalGroup("胜利失败星级条件/5")] [LabelText("3星条件"), Indent] [ReadOnly]
public string threeStarTask;
[FoldoutGroup("胜利失败星级条件")]
[HorizontalGroup("胜利失败星级条件/5")]
[Button("搜索/选择3星任务", ButtonSizes.Small)]
private void OpenThreeStarTaskSelector()
{
ShowTaskSelector("选择3星条件任务", taskName => threeStarTask = taskName, id => starTaskIDs[2] = id);
}
#endregion*/
#region 关卡数据
[FoldoutGroup("当前关卡数据")] [HideLabel]
@ -625,6 +555,24 @@ public partial class LevelEditorWindow : OdinEditorWindow
#endregion
#region 雷达
[FoldoutGroup("地区相关")]
[BoxGroup("地区相关/编辑雷达信息")]
[HorizontalGroup("地区相关/编辑雷达信息/radar")]
[LabelText("编辑雷达信息"), Indent]
[LabelWidth(100)]
[SerializeField]
private bool canEditorRadarInfo;
[FoldoutGroup("地区相关")]
[VerticalGroup("地区相关/编辑雷达信息/radarInfo"), Indent]
[LabelText("雷达列表")]
[ShowIf("canEditorRadarInfo")]
public List<RadarEditorInfo> radarInfoList = new();
#endregion
#region 雷区
[FoldoutGroup("地区相关")]
@ -1369,14 +1317,6 @@ public partial class LevelEditorWindow : OdinEditorWindow
currentLevelData.taskInfos = taskInfos.Select(t => t.taskInfo).ToList();
ProcessCondition();
/*// 胜利失败星级条件
currentLevelData.successTaskID = successTaskID;
currentLevelData.failTaskID = failTaskID;
for (var i = 0; i < starTaskIDs.Count; i++)
{
currentLevelData.starTaskIDs[i] = starTaskIDs[i];
}*/
// 地区
currentLevelData.preparingRegionId = curRegionData.preparingRegionId;
currentLevelData.preparingRegionToward = curRegionData.preparingRegionToward;
@ -1572,6 +1512,9 @@ public partial class LevelEditorWindow : OdinEditorWindow
// 关卡广播
currentLevelData.listAIBroadcastData = listAIBroadcastData.Select(a => a.aiBroadcastData).ToList();
// 雷达信息
currentLevelData.radarInfos = radarInfoList.Select(r => r.radarInfo).ToList();
// 阻挡球
SaveBlockSphereInfo();

View File

@ -209,94 +209,6 @@ public class CheckCaptureData : LevelValidatorBase
}
}
/// <summary>
/// 检查扛旗点
/// </summary>
public class CheckFlagData : LevelValidatorBase
{
private int flagCount;
public CheckFlagData(string levelDataPath, string mapDataPath) : base(levelDataPath, mapDataPath)
{
}
public override bool CheckData()
{
if (ErrorData) return false;
if (!CheckConditionSame(ConditionType.CombatSubmitFlag)) return true;
// 扛旗起点为最大扛旗数量
flagCount = LevelData.flagStartPoints.Count;
if (flagCount == 0)
{
ErrorMessage =
$"【地图数据:{MapDataPath} / 关卡数据:{LevelDataPath} 】扛旗关卡中配置的扛旗起点数量为 0";
return false;
}
if (LevelData.flagEndPoints.Count == 0)
{
ErrorMessage =
$"【地图数据:{MapDataPath} / 关卡数据:{LevelDataPath} 】扛旗关卡中配置的扛旗终点数量为 0";
return false;
}
/*
if (!CheckConditions(LevelData.stages.Select(stage => stage.successCondition), ConditionType.CombatSubmitFlag))
{
return false;
}
if (!CheckConditions(LevelData.starTarget, ConditionType.CombatSubmitFlag))
{
return false;
}
if (!CheckConditions(LevelData.scoreTarget, ConditionType.CombatSubmitFlag))
{
return false;
}
*/
return true;
}
private bool CheckConditions(IEnumerable<ConditionModifier> conditions, ConditionType filterType)
{
foreach (var condition in conditions)
{
if (condition.conditionType == filterType)
{
if (!Check(condition))
{
return false;
}
}
}
return true;
}
private bool Check(ConditionModifier modifier)
{
var count = (int)modifier.conditionArgs[0].Arg;
if (count == 0)
{
ErrorMessage =
$"【地图数据:{MapDataPath} / 关卡数据:{LevelDataPath} 】扛旗关卡中上交棋子参数为 0";
return false;
}
else if (count > flagCount)
{
ErrorMessage =
$"【地图数据:{MapDataPath} / 关卡数据:{LevelDataPath} 】扛旗关卡中上交棋子参数【{count}】大于实际配置扛旗起点数量【{flagCount}】";
return false;
}
return true;
}
}
/// <summary>
/// 检查关卡区域设置
/// </summary>

View File

@ -36,7 +36,6 @@ public class LevelValidatorWindow : OdinEditorWindow
"CheckAll", (levelDataPath, mapDataPath, dataLevel) => new LevelValidatorBase[]
{
new CheckCaptureData(levelDataPath, mapDataPath),
new CheckFlagData(levelDataPath, mapDataPath),
new CheckLevelRegionData(levelDataPath, mapDataPath),
new CheckScenePostProcess(dataLevel),
new CheckLevelCondition(levelDataPath, mapDataPath),
@ -49,12 +48,6 @@ public class LevelValidatorWindow : OdinEditorWindow
new CheckUselessGrid(levelDataPath, mapDataPath),
}
},
{
"CheckFlag", (levelDataPath, mapDataPath, dataLevel) => new LevelValidatorBase[]
{
new CheckFlagData(levelDataPath, mapDataPath)
}
},
{
"CheckCapture", (levelDataPath, mapDataPath, dataLevel) => new LevelValidatorBase[]
{