Hi,
ok, here we go, a simply example on how to use a FsmString to reference an enum:
using UnityEngine;
using System;
namespace HutongGames.PlayMaker.Actions
{
public class EnumAction : FsmStateAction
{
public FsmString wrapModeString;
public override void Reset()
{
wrapModeString = null;
}
public override void OnEnter()
{
if (wrapModeString.Value != "")
{
try{
WrapMode _temp = (WrapMode)Enum.Parse(typeof(WrapMode),wrapModeString.Value);
Debug.Log ("use String based WrapMode "+_temp);
}catch(Exception e)
{
string vals = String.Join(",", Enum.GetNames(typeof(WrapMode)));
Debug.LogWarning(wrapModeString.Value+" not a valid enum for WrapMode. Possible Values are: "+vals);
}
}
Finish();
}
}
}
you'll also see how I generate the full list of the enum to let the user know if the string is invalid and not representing one of the possible value of the enum.
Does that help you moving forward? let me know if you need something else,
bye,
Jean