03-08-2013, 03:22 AM
Add a function GetPriority to each behaviour and make it return a float value based on that behaviour, the current state and the surrounding or whatever that behaviour thinks is important.
After you got all priorities, execute the behaviour with the highest priority
After you got all priorities, execute the behaviour with the highest priority