- Home /
Saving script variations
Im working on a brawler game with different combo and fighting style, and i need a way of saving different variations of my ComboType script.
Does anyone have an idea how i can save a script with it being modified with information filled in it?
(Not looking to use XML serialization, because Unity doesnt export the .Dll with the build)
This is what we have fields for public values in the inspector for. Why can't you just use those? They serialise automatically, without need for any external libraries, and are the most straightforward way of storing any configuration data you may need.
The reason why is because i need to be able to save multiple varaitions and be able to load multiple of them in at load time, and from my knowledge you cant make a prefab out of just a script?
Answer by flamy · Jul 03, 2012 at 05:49 AM
what does dll not supported means. Why do you need dll when System.XML
classes work on all platforms, (though some won't in android) but it is good enough in your case, because you are just gonna read from the xml file not write it back (I'm saying this because i never tried writing in the device. writing may also work)
I was able to use all functions of XMLDocument class in device. Also XMLNodeList, XMLElement, XMLAttribute classes.
With my little knowledge, i can say that reading from xml seems to be the best in this case.
I tried using Xml serialization, but i had to find and include a .dll when i make my build, because Unity strips that funcionality when it exports a build. I suppose if theres no other way around it, i just really dont want have to include extra .dll's
hmm i didn't suggest you to use X$$anonymous$$LSerializer, which is stream based.. what i suggested is to use X$$anonymous$$LDocument, which is text based. ofc X$$anonymous$$LSerializer needs the dll to be added. Is there any special reason why you want to serialize your xml??
Oh ok nvm i see, is X$$anonymous$$LDocument supported without having to include any extra .dll's? and do you know of any easy way of ecrypting Xml files? Thanks :)
do you want to encrypt it while in editor and decrypt back and use xmlDocument something like this!??!
im not getting you
Sorry should probably explain more, im making a brawler game, so i make the combos in the editor filled with information, so that during the game the characters can load them in and use them.
So i need to be able to save them, and be able to load them in during runtime, but if i could find a way to encrypt them when i save them, that would keep them from being changed by the user
Hope that explained things better :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613073612im_/https://answers.unity.com/themes/thub/images/avi.jpg)