/////////////// private void InitBaseStats(JsonArray data) { JsonObject json = data.GetAt <JsonObject>(0); Health = json.GetInt("health"); BaseDamage = json.GetInt("damage"); // подписка на ивент обновления прогресса BattleManager.OnMissionComplete += TryUpdateProgress; }
/////////////// public void CreateNewProfile(JsonArray data) { JsonObject json = data.GetAt <JsonObject>(0); InitBaseStats(data); NormalWorldMissionNumber = json.GetInt(Constants.NormalWorldMissionNumber); FireWorldMissionNumber = json.GetInt(Constants.FireWorldMissionNumber); WaterWorldMissionNumber = json.GetInt(Constants.WaterWorldMissionNumber); AirWorldMissionNumber = json.GetInt(Constants.AirWorldMissionNumber); EarthWorldMissionNumber = json.GetInt(Constants.EarthWorldMissionNumber); DarknessWorldMissionNumber = json.GetInt(Constants.DarknessWorldMissionNumber); HeroEquipment = new Dictionary <EquipmentSlot, EquipmentItem>(); }
public bool Init(JsonObject json) { Id = (string)json["id"]; StartLevelNumber = json.GetInt("start_level_number"); _backgroundPath = (string)json["background"]; JsonArray cardIds = json.Get <JsonArray>("cards"); EnvironmentCards = new string[cardIds.Count]; for (int i = 0; i < EnvironmentCards.Length; i++) { EnvironmentCards[i] = cardIds.GetAt <string>(i); } return(true); }