Changing Script on the fly

Feb 8, 2010 at 6:01 PM

Is there any chance to change the component's script class on the fly? This would be nice for a lot of situations such as scripted scenes or something like that.


Feb 8, 2010 at 6:03 PM

I'm somewhat sure it's possible using Visual Studio's Edit-and-Continue feature. The feature must be turned on manually I believe. Once turned on, set a break point in your script UpdateHook, make a change, and see if it continues smoothly.

Good luck :)

Feb 8, 2010 at 6:10 PM

I think you are some kind of missing the point ;) I want to change the whole script class of a component from class a to class b. Surely I want to do this with code ;)



Feb 8, 2010 at 6:47 PM

Ah, I see! Interesting suggestion. I'll see about implementing it.



Feb 8, 2010 at 7:39 PM

This is now implemented in SVN. Change the script at play-time by setting the component's ScriptClass property.

Let me know if you have any issues!