ShanxiKnowledgeBase/SXElectricityInformationAcq.../Assets/Scripts/ToolsPack/ToolsPackWindowItemBtCompon...

39 lines
1.2 KiB
C#

using System;
using MotionFramework;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
namespace ToolsPack
{
public class ToolsPackWindowItemBtComponent : MonoBehaviour
{
[SerializeField] private RawImage ico;
[SerializeField] private GameObject closeBt;
private void Start()
{
closeBt.GetComponent<Button>().onClick.AddListener(delegate
{
(string str, GameObject toolsGame) = MotionEngine.GetModule<ToolsPackManager>().GetToolsPack(this.name);
toolsGame.SetActive(true);
MotionEngine.GetModule<ToolsPackManager>().DeleteToolsPack(this.name);
Destroy(this.gameObject);
});
}
public void Init(string gName)
{
ico.texture = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindowBtImage(gName);
if (MotionEngine.GetModule<ToolsPackManager>().GetToolsPackScene() == ToolsPackScene.)
{
closeBt.SetActive(true);
}
// else
// {
// closeBt.SetActive(false);
// }
}
}
}