2022-11-23 00:44:27 +08:00
|
|
|
|
using System;
|
|
|
|
|
using SHADE;
|
2023-02-04 00:23:05 +08:00
|
|
|
|
using SHADE_Scripting.Audio;
|
2022-11-23 00:44:27 +08:00
|
|
|
|
|
|
|
|
|
public class EndScene : Script
|
|
|
|
|
{
|
|
|
|
|
public uint mainGameScene = 86098106;
|
|
|
|
|
public uint mainMainScene = 97158628;
|
|
|
|
|
|
|
|
|
|
protected override void awake()
|
|
|
|
|
{
|
2023-02-04 00:23:05 +08:00
|
|
|
|
AudioHandler.audioClipHandlers["SFXMouseDownElement"] = Audio.CreateAudioClip("event:/UI/mouse_down_element");
|
|
|
|
|
AudioHandler.audioClipHandlers["SFXUISuccess"] = Audio.CreateAudioClip("event:/UI/success");
|
2022-11-23 00:44:27 +08:00
|
|
|
|
}
|
2023-03-01 23:56:40 +08:00
|
|
|
|
|
|
|
|
|
protected override void start()
|
|
|
|
|
{
|
|
|
|
|
Input.SetMouseCentering(false);
|
|
|
|
|
Application.IsCursorVisible = true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-23 00:44:27 +08:00
|
|
|
|
protected override void update()
|
|
|
|
|
{
|
2022-11-26 08:28:37 +08:00
|
|
|
|
if (Input.GetKeyDown(Input.KeyCode.R))
|
2022-11-23 00:44:27 +08:00
|
|
|
|
{
|
2023-02-04 00:23:05 +08:00
|
|
|
|
//Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
|
|
|
|
|
AudioHandler.audioClipHandlers["SFXMouseDownElement"].Play();
|
2022-11-26 08:28:37 +08:00
|
|
|
|
}
|
|
|
|
|
if (Input.GetKeyUp(Input.KeyCode.R))
|
|
|
|
|
{
|
2023-02-04 00:23:05 +08:00
|
|
|
|
//Audio.PlaySFXOnce2D("event:/UI/success");
|
2023-02-04 01:44:00 +08:00
|
|
|
|
//Audio.StopAllSounds();
|
2023-03-01 17:36:02 +08:00
|
|
|
|
AudioHandler.StopAllSounds(false);
|
2023-02-04 00:23:05 +08:00
|
|
|
|
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
|
2022-11-23 00:44:27 +08:00
|
|
|
|
SceneManager.ChangeScene(mainGameScene);
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-26 08:28:37 +08:00
|
|
|
|
if (Input.GetKeyDown(Input.KeyCode.M))
|
2022-11-23 00:44:27 +08:00
|
|
|
|
{
|
2023-02-04 00:23:05 +08:00
|
|
|
|
//Audio.PlaySFXOnce2D("event:/UI/mouse_down_element");
|
|
|
|
|
AudioHandler.audioClipHandlers["SFXMouseDownElement"].Play();
|
2022-11-26 08:28:37 +08:00
|
|
|
|
}
|
|
|
|
|
if (Input.GetKeyUp(Input.KeyCode.M))
|
|
|
|
|
{
|
2023-02-04 00:23:05 +08:00
|
|
|
|
//Audio.PlaySFXOnce2D("event:/UI/success");
|
2023-02-04 01:44:00 +08:00
|
|
|
|
//Audio.StopAllSounds();
|
2023-03-01 17:36:02 +08:00
|
|
|
|
AudioHandler.StopAllSounds(false);
|
2023-02-04 00:23:05 +08:00
|
|
|
|
AudioHandler.audioClipHandlers["SFXUISuccess"].Play();
|
2022-11-23 00:44:27 +08:00
|
|
|
|
SceneManager.ChangeScene(mainMainScene);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Input.GetKey(Input.KeyCode.Escape))
|
|
|
|
|
{
|
|
|
|
|
Application.Quit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|