public virtual async void Load() { if (!await SaveSystemAPI.ExistsAsync(this.identifier)) { return; } await SaveSystemAPI.LoadAsync <GameObject[]>(this.identifier, this.settingsPreset.CustomSettings); }
public override async void Load() { if (!await SaveSystemAPI.ExistsAsync(this.identifierField.text)) { Debug.Log("Player data not found"); Debug.Log("Using default player data instead"); this.playerData = this.defaultPlayerData; return; } this.playerData = await SaveSystemAPI.LoadAsync <PlayerData>(this.identifierField.text); this.playerNameField.text = this.playerData.name; this.playerCurrentHealthSlider.value = this.playerData.currentHealth; this.playerInventorySlotCount.text = this.playerData.inventory.slots.Count.ToString(); Debug.Log("Player data loaded successfully"); }
public static T Load <T>(string identifier, T defaultValue) { return(SaveSystemAPI.ExistsAsync(identifier).Result ? SaveSystemAPI.LoadAsync <T>(identifier).Result : defaultValue); }
public override async void Load() { this.dataField.text = await SaveSystemAPI.LoadAsync <string>(this.identifierField.text); }