- Home /
Upload C# scripts during game play
I am wondering if a C# script can be uploaded during game play as it is being played on a mobile device as in some sort of script reader.
Answer by fafase · Apr 26, 2016 at 06:31 PM
There should be possibilities to create some kind of runtime compiler but I doubt you need to go that far (And I can't assure Unity will support it but I think I read something unofcifial about this long ago).
Maybe best for you is AssetBundle, it allows to get a full game object with script on. The problem is that the script is isolated, it may know about the existing ones in the app, but the other way around won't do.
Best solution is an update of your app, at least it is safe and fairly common.
Interesting. What I want is to be able to upload AI scripts. I could do something with database and sql but that may prove to be sticky.
I guess that was meant to be a comment. Database are not really a way to go for that purpose. Db are meant to store information and state (score, ID, achievements) . You want to update AI scripts, so maybe AssetBundle will do. You would upload a new version of your AI and discard the old one. Your program would have to look for that new version and remove the old one. A default one would have to be shipped with the build.