Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I Check if there is saved data? #21

Closed
R0CK3T-DEV opened this issue Mar 23, 2020 · 2 comments
Closed

How can I Check if there is saved data? #21

R0CK3T-DEV opened this issue Mar 23, 2020 · 2 comments
Assignees

Comments

@R0CK3T-DEV
Copy link

R0CK3T-DEV commented Mar 23, 2020

When I try to check if there is saved data with SaveGame.Load<string>("SavedGame") != null , it says that I should use Exists(), but I don't know how to. And if this is a very easy thing, sorry. I'm not very good at Unity C# :/

@hasanbayatme
Copy link
Member

You can use Exists method in this case:

if (SaveGame.Exists("SavedGame")) {
     // Load the data here
    SaveGame.Load<string>("SavedGame");
}

i hope this helps.

@R0CK3T-DEV
Copy link
Author

It works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants