using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; //============================================================ //支持中文,文件使用UTF-8编码 //@author YangHua //@create 20230914 //@company QianHuo // //@description: //============================================================ public class ToolsItemController : MonoSingleton { public GameObject toolPanel; public List toolItems = new List(); public ToolItem toolItemPrefab; public Transform toolsContent; public Button closeBtn; private void Start() { closeBtn.onClick.AddListener(() => { SwictchToolPanel(false); }); } public void SwictchToolPanel(bool isActive) { toolPanel.SetActive(isActive); } public void SwitchToolsState() { } /// /// 在工具家生成图标 /// /// public void CreatToolItem(GameObject currentModel) { ToolItem tTemp = Instantiate(toolItemPrefab, toolsContent); tTemp.SetValue(currentModel.name, currentModel.transform); tTemp.SetState(true); toolItems.Add(tTemp); } }