From 86040c9d4be793a9bb1a0020e49e01bdcca89246 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 16 Jun 2015 14:49:49 +0100 Subject: [PATCH] Added Quit command to quit application https://trello.com/c/qIVLgrDx --- .../Fungus/Flowchart/Scripts/Commands/Quit.cs | 27 +++++++++++++++++++ .../Flowchart/Scripts/Commands/Quit.cs.meta | 12 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs create mode 100644 Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs.meta diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs new file mode 100644 index 00000000..0939d439 --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs @@ -0,0 +1,27 @@ +using UnityEngine; +using System; +using System.Collections; + +namespace Fungus +{ + [CommandInfo("Flow", + "Quit", + "Quits the application. Does not work in Editor or Webplayer builds. Shouldn't generally be used on iOS.")] + [AddComponentMenu("")] + public class Quit : Command + { + public override void OnEnter() + { + Application.Quit(); + + // On platforms that don't support Quit we just continue onto the next command + Continue(); + } + + public override Color GetButtonColor() + { + return new Color32(235, 191, 217, 255); + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs.meta b/Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs.meta new file mode 100644 index 00000000..6cf5a9c0 --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Quit.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3e1337544a71d4d5dab5510fe86ddca8 +timeCreated: 1434462164 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: