Home »Samples»TestLab»Button Door Prefab
Index

Button Door Prefab

This sample converts the Button Door to a prefab that can be spawned repeatedly with all its behavior intact.

The individual FSMs are described in more detail in the NoExit sample.

Some differences worth noting:

  • References to Door and Cursor FSMs were converted to variables so they can be set in one place.
  • Prefabs can only reference other prefabs (not scene objects - since those are temporary).
  • The Button FSM has an Init state to find the Cursor FSM in the scene.