Ejemplo n.º 1
0
    public static void saveToFile <E>(E progress, string fileName, int id, int worldId)
    {
        ES2.Delete(MasterDataManagerBase.getLoadPass(id, worldId, fileName));
        ES2Writer writer = ES2Writer.Create(MasterDataManagerBase.getLoadPassExceptTag(fileName));

        writer.Write <E>(progress, worldId + "" + id);
        writer.Save();
    }
Ejemplo n.º 2
0
 public void setState(int id, TitleManager title)
 {
     this.id        = id;
     data           = MasterDataManagerBase.loadSaveData <WorldData>(id, id, "WorldData");
     nameText.text  = data.WorldName;
     levelText.text = "Lv." + data.WorldLevel;
     WorldCreatFlugHelper.getInstance().changedName(data.WorldName);
     this.title = title;
 }
Ejemplo n.º 3
0
        public void loadWorld()
        {
            var data = MasterDataManagerBase.loadSaveData <WorldData>(id, id, "WorldData");

            this.towns      = data.Towns;
            this.worldLevel = data.WorldLevel;
            this.worldName  = data.WorldName;

            var ids = towns.Keys;

            foreach (int id in ids)
            {
                var        townBuilder = MasterDataManagerBase.loadSaveData <TownBuilder>(id, this.id, "TownData");
                GameObject townObject  = Instantiate(townPrefab);
                Town       town        = townObject.GetComponent <Town>();
                town.setState(townBuilder);
                town.transform.SetParent(fieldKeeper.transform);
                enableTowns.Add(town);
            }
        }