Пример #1
0
    public void Load()
    {
        buildingPlacement.clearBuilding();
        string saveData = File.ReadAllText(Application.dataPath + "/save.txt");

        if (saveData != null && saveData != "")
        {
            string[] saveObjects = saveData.Split(new[] { OBJECT_SEPERATOR }, System.StringSplitOptions.None);
            string[] dataObjects;
            foreach (string d in saveObjects)
            {
                dataObjects = d.Split(new[] { ATTRIBUTE_SEPERATOR }, System.StringSplitOptions.None);
                buildingPlacement.loadBuildings(dataObjects[0], findBuilding(dataObjects[1]), dataObjects[2], dataObjects[3], dataObjects[4]);
            }
        }
    }