SHADE_Y3/Assets/Scripts/UI/SC_ChangeSceneButton.cs

29 lines
535 B
C#

using System;
using SHADE;
public class ChangeSceneButton : Script
{
public uint sceneID = 0;
protected override void awake()
{
UIElement ui = GetComponent<UIElement>();
ui.OnClick.RegisterAction(() =>
{
if(sceneID != 0)
{
Audio.PlaySFXOnce2D("event:/UI/success");
SceneManager.ChangeScene(sceneID);
Audio.StopAllSounds();
}
});
}
protected override void update()
{
}
}