61 lines
1.7 KiB
C#
61 lines
1.7 KiB
C#
using System;
|
|
using SHADE;
|
|
using SHADE_Scripting.Audio;
|
|
using SHADE_Scripting.UI;
|
|
|
|
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 start()
|
|
{
|
|
Input.SetMouseCentering(false);
|
|
Debug.Log("EndScene::Start():");
|
|
Application.IsCursorVisible = true;
|
|
SceneFadeInOut.Instance.CallFadeOut();
|
|
}
|
|
|
|
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");
|
|
//Audio.StopAllSounds();
|
|
AudioHandler.StopAllSounds(false);
|
|
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
|
|
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");
|
|
//Audio.StopAllSounds();
|
|
AudioHandler.StopAllSounds(false);
|
|
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
|
|
SceneManager.ChangeScene(mainMainScene);
|
|
}
|
|
|
|
if (Input.GetKey(Input.KeyCode.Escape))
|
|
{
|
|
Application.Quit();
|
|
}
|
|
}
|
|
}
|