32 lines
618 B
C#
32 lines
618 B
C#
using System;
|
|
using SHADE;
|
|
|
|
public class QuitButton : Script
|
|
{
|
|
protected override void start()
|
|
{
|
|
UIElement ui = GetComponent<UIElement>();
|
|
if (ui != null)
|
|
{
|
|
ui.OnClick.RegisterAction(() =>
|
|
{
|
|
ui.OnClick.RegisterAction(() =>
|
|
{
|
|
Audio.StopAllSounds();
|
|
Application.Quit();
|
|
});
|
|
|
|
});
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("Failed to register button action for QuitButton.");
|
|
}
|
|
|
|
}
|
|
protected override void update()
|
|
{
|
|
|
|
}
|
|
}
|