32 lines
982 B
C#
32 lines
982 B
C#
using System;
|
|
using MotionFramework;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace ToolsPack
|
|
{
|
|
/// <summary>
|
|
/// 工具菜单按钮事件
|
|
/// </summary>
|
|
public class ToolsPackMenuBtOnClick : MonoBehaviour
|
|
{
|
|
private void Start()
|
|
{
|
|
this.GetComponent<Button>().onClick.AddListener(delegate
|
|
{
|
|
GameObject towin = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindowTemp();
|
|
if (towin == null)
|
|
{
|
|
GameObject win = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindow();
|
|
MotionEngine.GetModule<ToolsPackManager>().SetToolsPackWindowTemp(Instantiate(win, MotionEngine.GetModule<ToolsPackManager>().GetCanvas(), false));
|
|
}
|
|
else
|
|
{
|
|
towin.SetActive(true);
|
|
}
|
|
|
|
});
|
|
}
|
|
}
|
|
} |