2026-02-13 09:22:11 -05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using Cielonos.Core;
|
|
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Cielonos.MainGame.Map
|
|
|
|
|
|
{
|
|
|
|
|
|
[CreateAssetMenu(fileName = "MapBaseCollection", menuName = "Cielonos/BaseCollections/MainGameBaseCollection")]
|
|
|
|
|
|
public partial class MapBaseCollection : BaseCollection<MapBaseCollection>
|
|
|
|
|
|
{
|
2026-05-10 11:47:55 -04:00
|
|
|
|
[Title("Spawn Points"), SerializeField]
|
2026-02-13 09:22:11 -05:00
|
|
|
|
[Tooltip("不同组别对应的颜色,用于编辑器显示。注意,只需要SpawnPoint的groupName包含该字符串即可匹配。")]
|
2026-05-10 11:47:55 -04:00
|
|
|
|
private Dictionary<string, Color> _groupColors = new Dictionary<string, Color>();
|
|
|
|
|
|
public static Dictionary<string, Color> GroupColors => Instance._groupColors;
|
|
|
|
|
|
|
2026-02-13 09:22:11 -05:00
|
|
|
|
public Color GetGroupColor(string groupName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(groupName))
|
|
|
|
|
|
{
|
2026-05-10 11:47:55 -04:00
|
|
|
|
foreach (var pair in _groupColors.Where(pair => groupName.Contains(pair.Key)))
|
2026-02-13 09:22:11 -05:00
|
|
|
|
{
|
|
|
|
|
|
return pair.Value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return Color.white;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-05-10 11:47:55 -04:00
|
|
|
|
|
|
|
|
|
|
public partial class MapBaseCollection
|
|
|
|
|
|
{
|
|
|
|
|
|
[Title("Runtime Objects"), SerializeField]
|
|
|
|
|
|
private Dictionary<string, GameObject> _interactables = new Dictionary<string, GameObject>();
|
|
|
|
|
|
public static Dictionary<string, GameObject> Interactables => Instance._interactables;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public partial class MapBaseCollection
|
|
|
|
|
|
{
|
|
|
|
|
|
[SerializeField]
|
|
|
|
|
|
private Dictionary<string, GameObject> _enemies = new Dictionary<string, GameObject>();
|
|
|
|
|
|
public static Dictionary<string, GameObject> Enemies => Instance._enemies;
|
|
|
|
|
|
}
|
2026-02-13 09:22:11 -05:00
|
|
|
|
}
|