Game Progression Saving Script Question?

Hey everyone. I was wondering if someone could possibly point me in the right direction, if it is even possible, or if some package that will do what I’m trying to do already exists? I’ll try to explain this as simple as possible.

Basically I have a simple menu. There is a NEW GAME button and a CONTINUE button. The NEW GAME button works as intented with the script attached to take you to the first level. The CONTINUE button has a blank script attached to it.

I’m using the Javascripts from this thread on Writing and Reading a file.

What I’m attempting to do is, I have an empty GameObject in each level that has the Write File script attached to it where I’m wanting it to write a basic level loading script that overwrites the blank script that is already attached to the CONTINUE button so that the next time the player starts the game, the CONTINUE button will function and load up the last level they were on. This would happen for every level as a new script will get written on each level load. I’m not looking to do any kind of save states. I’m only looking to have a continue function for the menu button.

The thing I’m wondering is, is something like this even possible since when you do a build, all assets get packaged?

The other thing is, when you have the write file script write a line in the file it creates, everything is in quotation marks “some stuff goes here” but the other problem is, when you write an Application.LoadLevel (“thislevel”); you cannot put quotations within quotations to make that fuction. Or at least I have no idea how.

Also, is it possible to dictate where the files write and read files is written and read from? By default it is in the base game directly which isn’t accessible in the Heiarchy within the editor.

Any help would be greatly appreciated.

Wouldn’t you just use PlayerPrefs?

–Eric