I am really sorry guys, if the use of unity for anything else than game-making pisses you off.
-
STORY:
Our programming teacher had asked us to make a program for library management, and the deadline was coming really close. On the other hand, I was looking for something to do with unity, and suddenly it struck me, why don’t I… well, you know what happened. Don’t you?
**QUESTION: **
So, thanks to the new unity UI system, I made a decent UI system, and although I did not know how to use the UI.Button, I used OnGUI Button for that!
The main question arises, I want the ARRAYS (OR LISTS PREFERRABLY [i meant System.Collections.Generic.List <>]) OF TWO OF MY BASECLASSES (BASEBOOK and BASESTUDENT) to be saved on a database on the disk, where I can load it when I come back! (what use is a library manager if you need to create the records everytime you open the program?)
I thought PlayerPrefs could be used in this way, tell me if my approach is correct, or if there is a simpler way.
// Save Program
PlayerPrefs.SetInt ("length", bookslist.length);
for (int i=0;i<bookslist.length;i++) {
PlayerPrefs.SetString(i.ToString() + "name", bookslist*.name);*
PlayerPrefs.SetInt(i.ToString()+“id”, bookslist*.id);*
…
}
And use GetInt to get length and iterate over length to get the new objects to generate the list of objects.
Please tell me if there is a better or easier way. Thanks in advance!