コード例 #1
0
 public void initFromSavaData(LocalSaveData savedata)
 {
     table = new DungeonParameter[savedata.LocalDgData.DgParamTable.Length];
     for (int i = 0; i < table.Length; i++) {
         table[i] = savedata.LocalDgData.DgParamTable[i].toDgParameter();
     }
     CurrentIndex = Array.IndexOf(table, GameController.DungeonInformation.CurrentDungeonParameter);
 }
コード例 #2
0
 public static void doneConvert(LocalSaveData savedata)
 {
     DataConvert(savedata);
 }
コード例 #3
0
 public void dataConvert(LocalSaveData savedata)
 {
     PlayerData data = savedata.Player;
     CharacterParameterData paramdata = data.ParameterData;
     CurrentBuffs = StatusBuffBasis.convert(Controller,data.ParameterData.CurrentBuffs);
     this.initFromSavedata(paramdata);
     foreach (ItemBasis item in Inventory.toArray())
     {
         Debug.logger.Log("PlayerInventory", item.Name);
         if (!(item is EquipmentItemBasis)) continue;
         EquipmentItemBasis equip = item as EquipmentItemBasis;
         if (equip.IsEquipping) this.equip(equip,false,true);
     }
     this.MaxHunger = data.MaxHunger;
     this.CurrentHunger = data.CurrentHunger;
     this.CurrentHungerSpeed = data.CurrentHungerSpeed;
     this.NextHungerCount = data.NextHungerCount;
     this.AutoHealSpeed = data.AutoHealSpeed;
     this.NextAutoHealCount = data.NextAutoHealCount;
     this.Name = data.PlayerName;
     this.Pocket = data.Pocket;
     this.WareHouseLevel = data.WareHouseLevel;
     this.WareHouseInventory = ItemInventory.convert(WareHouseInventorySize, data.WareHouseInventory);
     this.Deposit = data.Deposit;
     this.ObjectClairvoyant = data.ObjectCrairvoyant;
     this.InvalidateCursing = data.InvalidateCursing;
     setLelelAtk();
 }
コード例 #4
0
 public void dataConvert(LocalSaveData savedata)
 {
     //this.gameObject.transform.position = savedata.Player.Position;
     initFromSavedata(savedata.Player);
 }
コード例 #5
0
 public SaveDataHeadder(LocalSaveData savedata)
 {
     PlayerName = savedata.Player.PlayerName;
     TimeStamp = savedata.TimeStamp;
     TotalPlayingTime = savedata.GlobalGameInfo.TotalPlayingTime;
 }
コード例 #6
0
 private static bool saveFile(uint filenumber,PlayerController player,DungeonInformation dginfo, DungeonParameterTable dgpramtable)
 {
     if (filenumber >= filename.Length) throw new ArgumentOutOfRangeException();
     string savepath = savedir + @"\" + filename[filenumber];
     LocalSaveData lcs = new LocalSaveData();
     lcs.setPlayerData(player);
     lcs.setDungeonData(dginfo,dgpramtable);
     lcs.setGlobalGameInformation(GameController.GlobalGameInformation);
     string json = JsonUtility.ToJson(lcs,true);
     Debug.Log(json);
     using (FileStream fs = new FileStream(savepath, FileMode.Create, FileAccess.Write)){
         BinaryFormatter bf = new BinaryFormatter();
         bf.Serialize(fs, json);
         return true;
     }
     return false;
 }
コード例 #7
0
 public static void testWrite()
 {
     if (!Directory.Exists(savedir)) {
         Debug.LogError("Save Directory is None!");
         Directory.CreateDirectory(savedir);
     }
     LocalSaveData test = new LocalSaveData();
     test.Player.Position = new Vector2(3, 7);
     test.Player.PlayerName = "たかし";
     var ken = new IronSword();
     ken.init(3);
     var arrow = new WoodArrow();
     arrow.init(12);
     var tubo = new HOZON();
     tubo.init(4);
     tubo.putinItem(arrow);
     Debug.Log("Pot: "+tubo.showInventory());
     ItemInventory inv = new ItemInventory(10);
     inv.add(ken,tubo,arrow);
     test.Player.ParameterData.Inventory = ItemData.convert(inv);
     test.Player.ParameterData.InventorySize = inv.InventorySize;
     string json =  JsonUtility.ToJson(test,true);
     Debug.Log(json);
     string savepath = savedir + @"\saveTest";
     using (FileStream fs = new FileStream(savepath,FileMode.Create,FileAccess.Write)) {
         BinaryFormatter bf = new BinaryFormatter();
         bf.Serialize(fs, json);
     }
     testLoad();
 }
コード例 #8
0
 public void dataConvert(LocalSaveData savedata)
 {
     GlobalGameInformation.removeEvent();
     GlobalGameInformation = savedata.GlobalGameInfo;
     //GlobalGameInformation.init();
     LocalDungeonData dgdata = savedata.LocalDgData;
     DungeonInformation.initFromSaveData(savedata.LocalDgData.DgInfo,savedata.Player);
     DgParameterTable.initFromSavaData(savedata);
 }