Search Unity

Saving Games

Discussion in 'Scripting' started by podperson, Jun 7, 2006.

  1. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    I assume I'm missing something, but how does one "save" games? (I mean as a player, not as a developer.)
     
  2. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
    It's very game specific what and how to save things. There's several systems that you can use: the PlayerPrefs class, writing directly to files, or accesing web-services with the WWW class.

    If you describe a specific problem, you're almost certain to get help on it.

    Enjoy,

    d.
     
  3. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    I couldn't find a file class. PlayerPrefs obviously sounds useful.

    Where do I look for things like reading from/writing to files?
     
  4. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
  5. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    Ah. I was hoping to avoid doing anything with .NET :)
     
  6. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
  7. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Hi,

    I work with an adventure game creation system (WME) which simply dumps a memory state (all variables inside a running game). Perhaps Unity could stream this data to a disk or server?
     
  8. Mike08

    Mike08

    Joined:
    Dec 29, 2005
    Posts:
    124
    Hi

    This is a plugin I wrote to write/save directly to harddisk.

    A script how to use it is included.

    I hope this will help you (You need Unity Pro for Plugins)

    By

    (To use it drag the Folder "Plugins" into the Assets Folder of your project)
     

    Attached Files:

  9. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    You can read/write files and custom files to the harddisk with .net from within the Unity scripting without any plugins like David said.

    It works really well.

    -Jeremy