How do I quit the game via dialogue?
Posted: Sat Jun 24, 2023 5:53 pm
How do I have a dialogue option quit the game?
Support and discussion forum for Pixel Crushers products
https://www.pixelcrushers.com:443/phpbb/
https://www.pixelcrushers.com:443/phpbb/viewtopic.php?t=7201
Code: Select all
[CreateAssetMenu(menuName = "Game/ApplicationBridge", fileName = "Application Bridge")]
public class ApplicationBridge: ScriptableObject
{
public void Quit()
{
Application.Quit();
}
}
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandQuitGame : SequencerCommand
{
private void Awake()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#endif
Application.Quit();
Stop();
}
}
}