|
Hi! I'm attending to create a level editor that'll work both on iOS/Android devices as on desktops. The goal is to save objects types and rotations on one dimensional level, so it should like: ...where the first variable will be position in meters from the beggining, second one, the object type, and the last one - Y rotation of an object. I need some other variables in those .ini(? or other?) like level lenght in meters, best scores etc. So, my question is - how to do it? How to save a file like that on android, iOS and desktop - to create levels? And, the next question is - how to read them to get the right variables? Thanks!
(comments are locked)
|
|
.NET handles file i/o with the System.IO namespace. You can probably find some forum/web posts that relate specifically to Unity, like this one. You'll have to deal with a number of issues, depending on which platforms you want to target. If you need help figuring out which folder you should be accessing, Unity will generally provide a safe location via Application.persistentDataPath. There are many ways to accomplish these tasks. If you're just getting started, you'll probably have a somewhat easier time using helper functions like File.ReadAllLines() and File.WriteAllLines(), so that you can read or write file contents line-by-line with a StringReader or StringWriter.
(comments are locked)
|
