Playmaker Forum
PlayMaker Updates & Downloads => Official Action Updates => Topic started by: Alex Chouls on August 06, 2011, 03:10:56 PM
-
EDIT: Just noticed Jean posted the same action ages ago!
http://hutonggames.com/playmakerforum/index.php?topic=113.0
Very simple, but useful action...
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Application")]
[Tooltip("Quits the player application.")]
public class ApplicationQuit : FsmStateAction
{
public override void Reset()
{
}
public override void OnEnter()
{
Application.Quit();
Finish();
}
}
}
You should be able to make any simple Unity command into an action by hacking this example.
Just change the action class name and the command in OnEnter.
-
Thanks.. you are great :-)
But it did not work.
Assets/PlayMaker/Actions/ApplicationQuit.cs(13,25): error CS0103: The name `Application' does not exist in the current context
Maybe its an other name when using CS??
-
Did you copy/paste, or download the cs file. Make sure you have using UnityEngine; at the top.
Also there are some usage notes here:
http://unity3d.com/support/documentation/ScriptReference/Application.Quit.html
-
Did you copy/paste, or download the cs file. Make sure you have using UnityEngine; at the top.
Also there are some usage notes here:
http://unity3d.com/support/documentation/ScriptReference/Application.Quit.html
Yes I did copy and past and you are right I did missed the top raw.. ::)
UPDATE:
I did try it out and it work just fine.
Thanks for the great support.
Also to show me how to make simple action script :-)
-
Sweeeeeet.
Q :D
-
Hi,
I can't quit my game with this code.
Is my method is correct please ?
(http://www.maximages.fr/forums/3D/playmaker/applicationquit.png)
Thanks
-
Hi
-- you can't quit your own app on IOS.
-- else, MOUSE DOWN transition may not be called.
Can you give a bit more context about your published platform etc.
bye,
Jean