playMaker

Author Topic: (C#) Get Current State-> Description?  (Read 1049 times)

dominickjohn

  • Playmaker Newbie
  • *
  • Posts: 2
(C#) Get Current State-> Description?
« on: November 27, 2015, 01:53:19 PM »
I've done my fair share of searching and digging into the API and couldn't find a direct way to grab the current state's description string... despite there being an FSM.FsmStates[int].Description command.

Is there some direct way to grab the current FsmState to access the Description variable? Even accessing the int of it in the FsmStates Array would help.

Right now this is my workaround... I'd rather not be doing these unnecessary loops if possible... thanks!!  :)

Code: [Select]
string result = "Error, state not found";

for (int i=0; i < fsm.FsmStates.Length; i++)
{
if(fsm.ActiveStateName == fsm.FsmStates[i].Name) result = fsm.FsmStates[i].Description;
}

storeResult.Value = result;
« Last Edit: November 27, 2015, 01:55:07 PM by dominickjohn »