Question by
Lonarti · Aug 04, 2016 at 07:36 PM ·
unity 5scripting problembugplayerprefs
PlayerPrefs mad?!
When I write my code, I expect nothing strange but then this happened....
Elements [0].GetComponent<InputField> ().text = D;
string[] vb = new string[2];
vb [0] = PlayerPrefs.GetString ("Von");
vb [1] = PlayerPrefs.GetString ("Bis");
if (!string.IsNullOrEmpty (vb [0]))
Elements [1].GetComponent<InputField> ().text = vb [0];
if (!string.IsNullOrEmpty (vb [1]))
Elements [2].GetComponent<InputField> ().text = vb [1];
Parent.GetComponent<RectTransform> ().sizeDelta = new Vector2(0, - 700 + (152 * (Work.Length - 1)));
string[] _bes = PlayerPrefs.GetString ("Beschreibung").Split(";"[0]);
print ("2" + PlayerPrefs.GetString ("Beschreibung"));
When I delete the part befor Parent.GetComponent blablabla the code works pretty well! But when not, it seems like it deleted the value from the key "Beschreibung"... I also set the key with a value and saved the PlayerPrefs! Why does PlayerPrefs behave so irrational? Please help...
(if you need the whole code, tell me)
Comment