yes this is my action day XDD
something i found myself very handy when working in iOS / Android and testing in unity editor to set up various control or behavior regarding your target platform.
using UnityEngine;
using HutongGames.PlayMaker;
[ActionCategory(ActionCategory.Input)]
[Tooltip("Check which platform we are running, useful to set various type of input corresponding to platform used use one action per platform")]
public class CheckPlatform : FsmStateAction
{
public RuntimePlatform platform;
public FsmEvent platformEvent;
public override void Reset ()
{
platform = RuntimePlatform.OSXEditor;
platformEvent = null;
}
public override void OnEnter ()
{
DoCheckPlatform();
Finish();
}
void DoCheckPlatform()
{
if(Application.platform == platform)
Fsm.Event(platformEvent);
}
}