how to save score in a system as a file in unity3d

Hi I am doing one mini game,in which while playing game,once finished first level my score will incremented smoothly,But my problem is once I quit that score will not remain,i don’t know how to save score in system as a file,so could any one have idea about that please help me ASAP

One easy way to store and recover a simple value is to use the PlayerPrefs class.

Use the PlayerPrefs to save and load values between sessions.

static function SaveProgress () {
    PlayerPrefs.SetInt("Player Score", scoreVariable);
static function LoadProgress () {
    scoreVariable = PlayerPrefs.GetInt("Player Score");

For even more functionality you could use ArrayPrefs2 made by Eric5h5.