- Home /
Advice wanted on state transition code.
Hi all, I made a simple game were I used enums for the different states a gameobject could be in (eg Walking, running etc). Now I want to go a step further and also want to have state transitions when switching states. I think I'll want to do it like this:
TransitionToState(int fromstate, int tostate)
Switch(fromstate)
Case 0:
If(tostate==1). // Do something
Know I wonder if this a clean way to do it, or does anyone have any pointers on doing this differently/better
Many thanks!
Your answer
Follow this Question
Related Questions
How i destroy the object of that part that collides with another object? 2 Answers
How to make keywords per material works properly (not in Editor) 0 Answers
スクリプトが追加できません。,スクリプトクラスが見つからない (I can't add a script. , Script class not found) 0 Answers
Failed to re-package resources Facebook-unity-sdk-7.11.1 2 Answers
Is it possible to have a changing line of script based off of variables? 0 Answers