Question by
heyMadsz · Sep 06, 2021 at 11:24 AM ·
playerprefsdllbug-perhaps
,PlayerPrefs stuck on event delegate
Hi! I created a .NET DLL using MonoBehaviour (Rider's default schema). When I try to use an event/delegate, PlayerPrefs crashes code execution. I can't do this or am I doing something wrong?
OnTokensChange += tokens =>
{
Debug.Log("Writing..."); // It is written to the console
PlayerPrefs.SetString("Test", tokens.RefreshToken);
Debug.Log("Saving..."); // It is not written to the console
PlayerPrefs.Save();
Debug.Log("Saved!"); // It is not written to the console
Debug.Log(PlayerPrefs.GetString("Test", "default_value"));
};
Comment
Your answer
Follow this Question
Related Questions
Unity mobile game build working from personal license but giving compile error with pro license 0 Answers
Reset score to what the value was at the start of the level (unless you have touched a checkpoint) 1 Answer
saving a text into a player pref 0 Answers
playerprefs 0 Answers
NullReferenceExeption but everything works great... 1 Answer