Search Unity

Scene Save/Load System: Binary Serialization Questions

Discussion in 'Scripting' started by davudovArtur, Sep 3, 2015.

  1. davudovArtur

    davudovArtur

    Joined:
    Jan 7, 2013
    Posts:
    2
    Hi guys!

    I'm want to create a save/load system for all non-static gameobjects in the scene.

    For example: In TES you enter in level and move some items/kill some NPC/loot chests etc, then you leave this place. And if you return on this level, all your acts (items, dead bodies, quest objects) will remain on the same places.

    i want to implement it by binary serialization. Here is the question:

    What is the best way to get variables, lists and enum-states from components?
    In tutorials recommends to use "reflect" classes: they are not inherited from MonoBehaviour and they stores all variables of components that i need to save. Is there another way? :)

    Thanks for help!
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    If this is one of the tutorials you've watched, that is basically the best way to save and load game data.
     
  3. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    Last edited: Sep 4, 2015
  4. davudovArtur

    davudovArtur

    Joined:
    Jan 7, 2013
    Posts:
    2
    Yep, I watched this lesson :) But this lesson explains basic concepts of binary serialization

    Thanks, Cherno! I will try to analyze your implementation of this feature!