SHADE_Y3/Assets/Scripts/UI/SC_MainMenu.cs

33 lines
636 B
C#

using System;
using SHADE;
public class MainMenu : Script
{
public uint sceneID;
protected override void awake()
{
Audio.PlayBGMOnce2D("event:/Music/main_menu");
}
protected override void update()
{
if (Input.GetKeyDown(Input.KeyCode.Space))
{
Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
}
if (Input.GetKeyUp(Input.KeyCode.Space))
{
Audio.PlaySFXOnce2D("event:/UI/success");
SceneManager.ChangeScene(sceneID);
Audio.StopAllSounds();
}
if (Input.GetKeyDown(Input.KeyCode.Escape))
{
Audio.StopAllSounds();
Application.Quit();
}
}
}