SHADE_Y3/Assets/Scripts/UI/SC_EndScene.cs

49 lines
1.4 KiB
C#

using System;
using SHADE;
using SHADE_Scripting.Audio;
public class EndScene : Script
{
public uint mainGameScene = 86098106;
public uint mainMainScene = 97158628;
protected override void awake()
{
AudioHandler.audioClipHandlers["SFXMouseDownElement"] = Audio.CreateAudioClip("event:/UI/mouse_down_element");
AudioHandler.audioClipHandlers["SFXUISuccess"] = Audio.CreateAudioClip("event:/UI/success");
}
protected override void update()
{
if (Input.GetKeyDown(Input.KeyCode.R))
{
//Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
AudioHandler.audioClipHandlers["SFXMouseDownElement"].Play();
}
if (Input.GetKeyUp(Input.KeyCode.R))
{
//Audio.PlaySFXOnce2D("event:/UI/success");
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
Audio.StopAllSounds();
SceneManager.ChangeScene(mainGameScene);
}
if (Input.GetKeyDown(Input.KeyCode.M))
{
//Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
AudioHandler.audioClipHandlers["SFXMouseDownElement"].Play();
}
if (Input.GetKeyUp(Input.KeyCode.M))
{
//Audio.PlaySFXOnce2D("event:/UI/success");
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
Audio.StopAllSounds();
SceneManager.ChangeScene(mainMainScene);
}
if (Input.GetKey(Input.KeyCode.Escape))
{
Application.Quit();
}
}
}