地图初步
This commit is contained in:
33
Assets/Scripts/MainGame/GameRun/Map/MapBaseCollection.cs
Normal file
33
Assets/Scripts/MainGame/GameRun/Map/MapBaseCollection.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public partial class MapBaseCollection
|
||||
{
|
||||
[Title("Spawn Points")]
|
||||
[Tooltip("不同组别对应的颜色,用于编辑器显示。注意,只需要SpawnPoint的groupName包含该字符串即可匹配。")]
|
||||
public Dictionary<string, Color> groupColors = new Dictionary<string, Color>();
|
||||
|
||||
public Color GetGroupColor(string groupName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(groupName))
|
||||
{
|
||||
foreach (var pair in groupColors.Where(pair => groupName.Contains(pair.Key)))
|
||||
{
|
||||
return pair.Value;
|
||||
}
|
||||
}
|
||||
return Color.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user