49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
//============================================================
|
||
//支持中文,文件使用UTF-8编码
|
||
//@author #AUTHOR#
|
||
//@create #CREATEDATE#
|
||
//@company #COMPANY#
|
||
//
|
||
//@description:
|
||
//============================================================
|
||
|
||
public class ToolsItemManager : MonoSingleton<ToolsItemManager>
|
||
{
|
||
public List<ToolItem> toolItems = new List<ToolItem>();
|
||
public ToolItem toolItemPrefab;
|
||
public Transform toolsContent;
|
||
public Button closeBtn;
|
||
private void Start()
|
||
{
|
||
closeBtn.onClick.AddListener(OnClose);
|
||
}
|
||
|
||
private void OnClose()
|
||
{
|
||
gameObject.SetActive(false);
|
||
}
|
||
|
||
public void SwitchToolsState()
|
||
{
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 在工具家生成图标
|
||
/// </summary>
|
||
/// <param name="toolName"></param>
|
||
public void CreatToolItem(GameObject currentModel)
|
||
{
|
||
ToolItem tTemp = Instantiate(toolItemPrefab, toolsContent);
|
||
tTemp.SetValue(currentModel.name, currentModel.transform);
|
||
tTemp.SetState(true);
|
||
toolItems.Add(tTemp);
|
||
}
|
||
|
||
|
||
}
|