33 lines
901 B
C#
33 lines
901 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 正在使用的工具/材料管理类
|
|
/// </summary>
|
|
public class ToolAndmaterialMgr : BaseManager<ToolAndmaterialMgr>
|
|
{
|
|
//该系统所需要使用的全部工器具和材料
|
|
|
|
public List<D_ToolAndMaterialData> toolAndMaterialList = new List<D_ToolAndMaterialData>();
|
|
|
|
private ToolAndmaterialMgr()
|
|
{
|
|
}
|
|
|
|
public void Init(string toolOrMaterilOrDevice)
|
|
{
|
|
toolAndMaterialList = GameManager.DataMgr.GetCurrentSystemToolAndMaterials(toolOrMaterilOrDevice);
|
|
}
|
|
|
|
|
|
public D_ToolAndMaterialData GetToolOrMaterialOrDeviceInfoByObjName(string objName)
|
|
{
|
|
for (int i = 0; i < toolAndMaterialList.Count; i++)
|
|
{
|
|
if (toolAndMaterialList[i].objName == objName)
|
|
return toolAndMaterialList[i];
|
|
}
|
|
return null;
|
|
}
|
|
} |