SHADE_Y3/Assets/Scripts/UI/SC_ChangeCanvasButton.cs

43 lines
812 B
C#
Raw Normal View History

2023-03-02 16:26:49 +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();
canvasToActivate.SetActive(true);
});
}
protected override void start()
{
}
protected override void update()
{
}
}
}