playMaker

Author Topic: Use a FSM without a gameObject  (Read 1241 times)

bmargogne

  • Playmaker Newbie
  • *
  • Posts: 1
Use a FSM without a gameObject
« on: July 19, 2017, 10:09:21 AM »
Hello !

Our project is using Playmaker to describe part of the game logic in a finite state machine. At the moment we would like to write unit tests (NUnit framework). As such, we do NOT want to be dependant on a loaded scene... hence NO gameobjects, NO "update" methods, etc....

I want to know if it is possible to use the possibilities of PlaymakerFSM -at least partially- without the need of a component on a gameobject ?

At the moment, I created a template FSM which I use to create a "Fsm" object directly.

Code: [Select]
Fsm myTestFsm = new Fsm(myFsmTemplate.fsm);
From this, I have access to the first State, plus its actions and events.
Now I would like to send an FsmEvent to move the stateMachine to the next state, but I could not manage to make it work using "BroadcastEvent()" (or anything else...).

Is there a way to do so ?

Thank you in advance !

Bertrand