- Home /
Saving/Loading Arrays to file?
My inventory based on Array : inventory[i][k]. How can i save this array to file? In array i have:
public class InventoryItem
{
var worldObject: GameObject;
var itemIcon: Texture;
var itemName : String;
var itemDescription : String;
var Stack : int;
var MaxStack : int;
}
I need it to save game. Thank you guys!
Comment
Answer by Paulius-Liekis · Jun 15, 2011 at 08:57 PM
You need Serializable attribute on your class:
http://unity3d.com/support/documentation/ScriptReference/Serializable.html