Game Development Community

Call a function using a behavior field

by Andrea Farid Marsili · in General Discussion · 10/31/2011 (3:59 am) · 2 replies

It's possibile to do? Can I call a function using a string BehaviorField?

#1
10/31/2011 (10:02 am)
Yes. Have a look at the Feature Demo, specifically the level selector. We are using GenericButtonBehavior to accomplish what you are looking for.
#2
11/01/2011 (6:00 am)
Thank you Mich. While I was taking a look at Features Demo's script I saw levelSelectButton script.
In this post:

http://www.garagegames.com/community/forums/viewthread/128366

I'm asking info about a proper way to load and unload level. If I write
hudWindow.endLevel();   
sceneWindow2D.endLevel();

into my script my game crash but I cannot understand why because in levelSelectButton script you're using endLevel() function with no problem. Can you give me some advice about using endLevel() or about implementing levelSelectButton for my game where I've got two SceneGraph (one for GUI and one for level)