43 lines
1.6 KiB
C#
43 lines
1.6 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
namespace Cielonos.MainGame
|
|||
|
|
{
|
|||
|
|
[Serializable]
|
|||
|
|
public class RunMapNode
|
|||
|
|
{
|
|||
|
|
public Vector2Int gridPosition; // 节点在网格中的坐标
|
|||
|
|
public MapNodeType nodeType;
|
|||
|
|
public Vector2 position; // UI 定位用
|
|||
|
|
public string sceneName; // 对应的 ZoneData.sceneName(战斗节点)
|
|||
|
|
public string zoneDataAssetName; // 关联的 ZoneData 资产名
|
|||
|
|
public List<Vector2Int> connectedPositions; // 双向连接的相邻节点坐标列表
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 该节点的连接数(度数)。度数为 1 的节点为"死胡同"。
|
|||
|
|
/// </summary>
|
|||
|
|
public int Degree => connectedPositions?.Count ?? 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public enum MapNodeType
|
|||
|
|
{
|
|||
|
|
Start, // 起始节点
|
|||
|
|
NormalCombat, // 普通战斗
|
|||
|
|
EliteCombat, // 精英战斗(更强的敌人配置)
|
|||
|
|
BossCombat, // Boss 战
|
|||
|
|
MechanicalTable, // 机械台(宝箱房,可获取装备)
|
|||
|
|
LogisticsCenter, // 物流中心(商店)
|
|||
|
|
MedicalStation, // 医疗站点(恢复HP)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Serializable]
|
|||
|
|
public class RunMapData
|
|||
|
|
{
|
|||
|
|
public Dictionary<Vector2Int, RunMapNode> nodes; // 所有节点,按网格坐标索引
|
|||
|
|
public Vector2Int startPosition; // 起始节点坐标
|
|||
|
|
public Vector2Int bossPosition; // Boss 节点坐标
|
|||
|
|
public int totalNodes; // 节点总数
|
|||
|
|
}
|
|||
|
|
}
|