public string SaveClass() { SaveReciteTimeAndClearArray(); RecordPassSceneTime(); ClassSaveHelper helper = new ClassSaveHelper(); helper.SaveValue(nameof(deathNumberInScenes), deathNumberInScenes); helper.SaveValue(nameof(deadBySlimer), deadBySlimer); helper.SaveValue(nameof(deadByMinotaur), deadByMinotaur); helper.SaveValue(nameof(deadByWitch), deadByWitch); helper.SaveValue(nameof(deadByFalling), deadByFalling); helper.SaveValue(nameof(deadByYourself), deadByYourself); helper.SaveValue(nameof(hitBySlimer), hitBySlimer); helper.SaveValue(nameof(hitByMinotaur), hitByMinotaur); helper.SaveValue(nameof(hitByWitch), hitByWitch); helper.SaveValue(nameof(fireElementConsumption), fireElementConsumption); helper.SaveValue(nameof(thunderElementConsumption), thunderElementConsumption); helper.SaveValue(nameof(iceElementConsumption), iceElementConsumption); helper.SaveValue(nameof(windElementConsumption), windElementConsumption); helper.SaveValue(nameof(passSceneTimes), passSceneTimes); helper.SaveValue(nameof(MSpellTime), MSpellTime); helper.SaveValue(nameof(MASpellTime), MASpellTime); helper.SaveValue(nameof(MBSpellTime), MBSpellTime); helper.SaveValue(nameof(ASpellTime), ASpellTime); helper.SaveValue(nameof(BSpellTime), BSpellTime); helper.SaveValue(nameof(MABSpellTime), MABSpellTime); helper.SaveValue(nameof(jumpNumber), jumpNumber); helper.SaveValue(nameof(shortSpellTime), shortSpellTime); helper.SaveValue(nameof(fullySpellTime), fullySpellTime); helper.SaveValue(nameof(wantFullyButFailedTimeForShortPressedTime), wantFullyButFailedTimeForShortPressedTime); helper.SaveValue(nameof(wantFullyButFailedTimeForElementNotEnough), wantFullyButFailedTimeForElementNotEnough); helper.SaveValue(nameof(wantFullyButFailedTimeForBeInterrupted), wantFullyButFailedTimeForBeInterrupted); return(helper.GetJsonString()); }
public void LoadClass(string content) { ClassSaveHelper helper = new ClassSaveHelper(); helper.LoadClassJsonString(content); helper.LoadValue(nameof(deathNumberInScenes), out deathNumberInScenes); helper.LoadValue(nameof(deadBySlimer), out deadBySlimer); helper.LoadValue(nameof(deadByMinotaur), out deadByMinotaur); helper.LoadValue(nameof(deadByWitch), out deadByWitch); helper.LoadValue(nameof(deadByFalling), out deadByFalling); helper.LoadValue(nameof(deadByYourself), out deadByYourself); helper.LoadValue(nameof(hitBySlimer), out hitBySlimer); helper.LoadValue(nameof(hitByMinotaur), out hitByMinotaur); helper.LoadValue(nameof(hitByWitch), out hitByWitch); helper.LoadValue(nameof(fireElementConsumption), out fireElementConsumption); helper.LoadValue(nameof(thunderElementConsumption), out thunderElementConsumption); helper.LoadValue(nameof(iceElementConsumption), out iceElementConsumption); helper.LoadValue(nameof(windElementConsumption), out windElementConsumption); helper.LoadValue(nameof(passSceneTimes), out passSceneTimes); helper.LoadValue(nameof(MSpellTime), out MSpellTime); helper.LoadValue(nameof(MASpellTime), out MASpellTime); helper.LoadValue(nameof(MBSpellTime), out MBSpellTime); helper.LoadValue(nameof(ASpellTime), out ASpellTime); helper.LoadValue(nameof(BSpellTime), out BSpellTime); helper.LoadValue(nameof(MABSpellTime), out MABSpellTime); helper.LoadValue(nameof(jumpNumber), out jumpNumber); helper.LoadValue(nameof(shortSpellTime), out shortSpellTime); helper.LoadValue(nameof(fullySpellTime), out fullySpellTime); helper.LoadValue(nameof(wantFullyButFailedTimeForShortPressedTime), out wantFullyButFailedTimeForShortPressedTime); helper.LoadValue(nameof(wantFullyButFailedTimeForElementNotEnough), out wantFullyButFailedTimeForElementNotEnough); helper.LoadValue(nameof(wantFullyButFailedTimeForBeInterrupted), out wantFullyButFailedTimeForBeInterrupted); }
public string SaveClass() { ClassSaveHelper helper = new ClassSaveHelper(); helper.SaveValue(nameof(hp), hp); return(helper.GetJsonString()); }
public void LoadClass(string content) { ClassSaveHelper helper = new ClassSaveHelper(); helper.LoadClassJsonString(content); helper.LoadValue(nameof(hp), out hp); }
public string SaveClass() { ClassSaveHelper helper = new ClassSaveHelper(); helper.SaveValue(nameof(transform.position), SerializableConvert.GetSerializableVector3(transform.position)); return(helper.GetJsonString()); //Dictionary<string, string> content = new Dictionary<string, string>(); //content.Add(nameof(transform.position), JsonConvert.SerializeObject(SerializableConvert.GetSerializableVector3(transform.position))); //return JsonConvert.SerializeObject(content); }
public void LoadClass(string content) { ClassSaveHelper helper = new ClassSaveHelper(); helper.LoadClassJsonString(content); SerializableVector3 temp; helper.LoadValue(nameof(transform.position), out temp); transform.position = SerializableConvert.DeserializableVector3(temp); //Dictionary<string, string> dicContent = JsonConvert.DeserializeObject<Dictionary<string, string>>(content); //string temp; //dicContent.TryGetValue(nameof(transform.position), out temp); //transform.position = SerializableConvert.DeserializableVector3(JsonConvert.DeserializeObject<SerializableVector3>(temp)); }