48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 正在使用的工具/材料管理类
|
|
/// </summary>
|
|
public class ToolAndmaterialMgr : BaseManager<ToolAndmaterialMgr>
|
|
{
|
|
//该系统所需要使用的全部工器具和材料
|
|
|
|
public List<TB_ToolAndMaterial> toolAndMaterialList;
|
|
|
|
private ToolAndmaterialMgr()
|
|
{
|
|
}
|
|
|
|
//public void Init()
|
|
//{
|
|
// toolAndMaterialList = GameManager.DataMgr.GetCurrentSystemToolAndMaterials();
|
|
//}
|
|
|
|
public string GetIconSpriteName(string objName)
|
|
{
|
|
var tempObj= toolAndMaterialList.Find(o => o.objName == objName);
|
|
if (tempObj!=null)
|
|
{
|
|
return tempObj.iconSpriteName;
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public int GetObjType(string objName)
|
|
{
|
|
var tempObj= toolAndMaterialList.Find(o => o.objName == objName);
|
|
if (tempObj!=null)
|
|
{
|
|
return tempObj.type;
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
} |