Hi
I am also trying to access a playmaker FSM from a .cs script. In this tread Jean mentioned that the code in the tutorial is the same for c# as well, but i cant run my code sense i added the variabel and the line of code that will fire of the playmaker event.
this is the variabel:
var sendFSM : PlayMakerFSM;
sendFSM = GameObject.Find("EndOfLevelObject").GetComponent.<PlayMakerFSM>();
And this is the script i wrote that will fire of an FSM event once the level is completed:
private bool IsLevelClear ()
{
for (int y = 0; y < rows; y++) {
for (int x = 0; x < columns; x++) {
if ((gridDescriptor [x, y] != (int)TileType.NoTile) &&
(gridDescriptor [x, y] != (int)TileType.Done)) {
return false;
}
}
}
Debug.Log("Level is Completed);
sendFSM.Fsm.Event("LevelCompleted");
return true;
i get these following error messages:
Assets/Scripts/Board.cs(551,21): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
Assets/Scripts/Board.cs(551,35): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
Assets/Scripts/Board.cs(553,17): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
Assets/Scripts/Board.cs(553,34): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
Assets/Scripts/Board.cs(553,68): error CS1519: Unexpected symbol `<' in class, struct, or interface member declaration
Assets/Scripts/Board.cs(553,81): error CS1519: Unexpected symbol `>' in class, struct, or interface member declaration