Problem Saving game progress

Hi, i’m new in Unity, and i have a question about saving game progress. I create a simple code to write on a text file to save Levels Number, so i do this -System.IO.File.WriteAllText();- it works perfectly in Unity, but once i want to build it for ios, i have an error message about AssetDatabase.Refresh(); unknown, when i remove this, my code didn’t work anymore, i can load data information from the TextAsset file, but can’t write or can’t refresh the asset. So i wonder if this is the best way to do that, and if there is a solution to this.

PS : Working on 2D game for ios (not an online Game)

Thanks. Best regards

The Code :

import System.IO;

function Update()
{
if (Input.GetMouseButtonDown(0))
{
var hit : RaycastHit2D = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
if(hit.collider.name == “Button-Enter”)
{
System.IO.File.WriteAllText(Application.dataPath + “/Save-Levels.txt”, “3”);
AssetDatabase.Refresh();
}
}
}

You cannot use PlayerPrefs?