SHADE_Y3/Assets/Scripts/UI/SC_ChangeCanvasButton.cs

42 lines
868 B
C#

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()
{
}
protected override void start()
{
//if (canvasToActivate.GetComponent<Canvas>() == null)
// return;
UIElement ui = GetComponent<UIElement>();
ui.OnRelease.RegisterAction(() =>
{
Canvas.DeactivateAllCanvas();
canvasToActivate.SetActive(true);
Debug.Log("CANVAS CHANGED ");
});
}
protected override void update()
{
}
}
}