SHADE_Y3/Assets/Scripts/UI/SC_ChangeCanvasButton.cs

43 lines
812 B
C#
Raw Permalink Normal View History

2023-02-27 08:08:04 +08:00
using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SHADE_Scripting.UI
{
public class ChangeCanvasButton:Script
{
public GameObject canvasToActivate;
protected override void awake()
{
//if (canvasToActivate.GetComponent<Canvas>() == null)
// return;
UIElement ui = GetComponent<UIElement>();
ui.OnRelease.RegisterAction(() =>
{
Canvas.DeactivateAllCanvas();
2023-02-27 09:55:54 +08:00
2023-02-27 08:08:04 +08:00
canvasToActivate.SetActive(true);
2023-02-27 09:55:54 +08:00
2023-02-27 08:08:04 +08:00
});
}
2023-02-27 09:55:54 +08:00
protected override void start()
{
}
2023-02-27 08:08:04 +08:00
protected override void update()
{
}
}
}