Differentiate between Load overloads ?

Discussion and help for Easy Save 3
Post Reply
mikemnd
Posts: 11
Joined: Wed Dec 30, 2020 4:11 pm

Differentiate between Load overloads ?

Post by mikemnd »

I'm trying to load a string from saved data, but the problem is I want to set a default value of the string
There are two overloads:

Code: Select all

public static T Load<T>(string key, string filePath, ES3Settings settings)
and

Code: Select all

public static T Load<T>(string key, T defaultValue, ES3Settings settings)
And I want to second one, but this code runs the first one:

Code: Select all

ES3.Load<string>(_saveKeyLastPlayedTime, "", PersistantManager.Instance.CacheSettings);
So what's the right way to specify that the second parameter is default value and not a <string> path ?
User avatar
Joel
Moodkie Staff
Posts: 4848
Joined: Wed Nov 07, 2012 10:32 pm

Re: Differentiate between Load overloads ?

Post by Joel »

Hi there,

You can use the ES3.LoadString(string key, string defaultValue, string filePath=null) method rather than ES3.Load<string> method to do this.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply