Hi All,
I’m new to Unity and C#, but old to c++ and games. So I’m trying to get my head around unity concepts and hope people can get me on the right track. From what I can understand Unity is event driven ( bit like QT some windows systems etc ). The way I currently program games is I use a finite state to control where I’m at. Basically I have a two dimensional array of states ( functions ). I then use a pointer to control the state. Each state returns where it needs to go to next depending on events. So at a ( very )basic level,
load graphics and sounds to demo state
|
run demo if no start rerun demo, if start game state
|
game state if player alive game state, if dead demo state
There’s much more states than this of course but I hope this helps show what I do. In unity should I think about a totally new way to implement game flow? Can I use state machines? If so how do I get around the issue of Unity scripts, do I turn of events eg say something like
void FixedUpdate()
{
if( state == PLAYER_DEAD ) return( DIE_STATE );
else
{
player presses keys ect;
}
}
Or is there a better way to handle states. Do any plug ins allow me to design states and add my own code scripts? I’ve seen playmaker but think this is over kill for what I need and would rather program all game logic myself. But it would be nice to have a visualisation of the main state machine.
So Total rethink, or tool / code to assist, or how to I link the current state with the script event functions?
Thanks All.