SHADE_Y3/Assets/Scripts/UI/SC_MainMenu.cs

32 lines
614 B
C#
Raw Normal View History

2022-11-22 16:18:16 +08:00
using System;
using SHADE;
public class MainMenu : Script
2022-11-22 16:18:16 +08:00
{
protected override void awake()
{
Audio.PlayBGMOnce2D("event:/Music/main_menu");
2022-11-22 16:18:16 +08:00
}
protected override void update()
{
if (Input.GetKeyDown(Input.KeyCode.Space))
{
2022-11-23 00:44:27 +08:00
Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
}
if (Input.GetKeyUp(Input.KeyCode.Space))
{
Audio.PlaySFXOnce2D("event:/UI/success");
SceneManager.ChangeScene(86098106);
Audio.StopAllSounds();
}
2022-11-23 00:44:27 +08:00
if (Input.GetKeyDown(Input.KeyCode.Escape))
2022-11-23 00:44:27 +08:00
{
Audio.StopAllSounds();
2022-11-23 00:44:27 +08:00
Application.Quit();
}
2022-11-22 16:18:16 +08:00
}
}