Hello. Is there a good tutorial on how to save in Unity?
I don’t need a savegame, I need saved levels. If possible, also arraylists of multiple objects with different properties.
Hello. Is there a good tutorial on how to save in Unity?
I don’t need a savegame, I need saved levels. If possible, also arraylists of multiple objects with different properties.
You might want to have a look at this one: http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/persistence-data-saving-loading
If you don’t want to use PlayerPrefs, I can highly recommend the EasySave2-Plugin, awesome stuff!
Here’s an excellent tutorial on how to save and load your own data classes without using PlayerPrefs.
Thank yo
u.
How can I save something like this though?
class PotatoFarm {
ArrayList Plants = new ArrayList();
void Grow() {
for (var i=0; i<12;i++)
{
Potato This=new Potato();
This.Potatoishness=i;
this.Plants.Add(This);
}
}
}
class Potato {
public float Potatoishness;
}
I wanna save an arraylist of classes with different properties.
class ForumAvatar{
public Sprite[] Data;
void LoadSprites() {
Data= Resources.LoadAll<Sprite>("Avatar");
}
}
I want to save sprites. Is it possible somehow? So that players can load their own sprites into a game?
That video should answer your first question if you watch the whole way through.
Sprites are a different story. You would probably have to use something like EncodeToPNG.