37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UVC.Core;
|
|
|
|
public class ShapeIconCatalog : SingletonScene<ShapeIconCatalog>
|
|
{
|
|
Dictionary<string,Sprite> iconMap = new Dictionary<string,Sprite>();
|
|
private readonly Dictionary<string, string> iconPaths = new Dictionary<string, string>()
|
|
{
|
|
{"box","Images/GridCellIcon/si_icon_box"},
|
|
{"flexible","Images/GridCellIcon/si_icon_flexible"},
|
|
{"sheet","Images/GridCellIcon/si_icon_flexible"},
|
|
{"barrel","Images/GridCellIcon/si_icon_barrel"},
|
|
{"bottle","Images/GridCellIcon/si_icon_bottle"},
|
|
{"coil","Images/GridCellIcon/si_icon_coil"},
|
|
{"powder","Images/GridCellIcon/is_icon_powder"},
|
|
{"hazard","Images/GridCellIcon/si_icon_hazard"}
|
|
};
|
|
|
|
protected override void Init()
|
|
{
|
|
foreach (var path in iconPaths)
|
|
{
|
|
iconMap.Add(path.Key,Resources.Load<Sprite>(path.Value));
|
|
}
|
|
}
|
|
|
|
public Sprite GetIcon(string key)
|
|
{
|
|
if (iconMap.ContainsKey(key))
|
|
{
|
|
return iconMap[key];
|
|
}
|
|
return null;
|
|
}
|
|
}
|