// выбран сейф из меню выбора public void save_chosen(als_save_data data) { if (_data != data) { _data = data; fill(); _loaded_time = DateTime.Now; } utils.restart_level(); }
// проверка облачного сейва, и отображения выбора актуального при необходимости public void check_cloud_save(als_save_data cloud) { if (!_data.level_arr.Equals(cloud.level_arr) || _data.useable_items_got != cloud.useable_items_got) { var o = utils.resource_instantiate("save_choose_modal"); var m = o.GetComponent <save_choose_modal>(); m.show_save_choose_menu(_data, cloud); } }
public void show_save_choose_menu(als_save_data local, als_save_data cloud) { local_played_time.text = string.Format("{0:c}", TimeSpan.FromSeconds(local.total_played_seconds)); cloud_played_time.text = string.Format("{0:c}", TimeSpan.FromSeconds(cloud.total_played_seconds)); local_item_count.text = utils.bit_count(local.useable_items_got).ToString(); cloud_item_count.text = utils.bit_count(cloud.useable_items_got).ToString(); int green = 0; int blue = 0; int yellow = 0; local.do_foreach_level((s_level_save level) => { level.token_fill(); if (level.opened) { ++green; } blue += level.token_blue_got_count; yellow += level.token_yellow_got_count; }); local_green.text = green.ToString(); local_blue.text = blue.ToString(); local_yellow.text = yellow.ToString(); green = 0; blue = 0; yellow = 0; cloud.do_foreach_level((s_level_save level) => { level.token_fill(); if (level.opened) { ++green; } blue += level.token_blue_got_count; yellow += level.token_yellow_got_count; }); cloud_green.text = green.ToString(); cloud_blue.text = blue.ToString(); cloud_yellow.text = yellow.ToString(); Time.timeScale = 0f; }
// загрузка сохраненных данных public void load_data() { _data = new als_save_data(); _data.load(_const_save_data[_current_player_id]); _loaded_time = DateTime.Now; }