Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[RELEASED] Runtime Serialization for Unity - Extremely easy solution to save your gameplay data

Discussion in 'Assets and Asset Store' started by Voxel-Busters, May 14, 2015.

?

Does serializing Scene Hierarchy feature, be useful to resume your game?

  1. Yes, definitely!

    79.2%
  2. Not sure!

    16.4%
  3. No, not much!

    4.5%
  1. PHARAOH_D

    PHARAOH_D

    Joined:
    Jan 11, 2014
    Posts:
    1
    As I understand it also must works on WebGL platform? or Im wrong? Tell me please you test it on WebGL or not? Actually Im interested deserialization on WebGL
     
  2. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi Voxel Buster
    I want to access RSManager in OnDestroy(), but it seems destroyed before. Could you add some magic letting the manager get destroyed after all the monobehaviours? thanks!
     
  3. JustSuds

    JustSuds

    Joined:
    Jul 25, 2013
    Posts:
    7
    Hey, You've done great work with the RS asset. I'm wondering if it would be possible to add 3D jagged arrays? int[,,] in particular.
     
  4. Tafk

    Tafk

    Joined:
    Feb 5, 2013
    Posts:
    20
    Is it possible to not serialize full hierarchy of the object? I see a check box for a childrens, but there is no such thing for a parents of my object and it seems right now it is working that way.
     
  5. bable631

    bable631

    Joined:
    Nov 28, 2014
    Posts:
    1
    I just recently bought and installed this, and I think that it's great. However, there really needs to be serialization for several other components that are used somewhat consistently (in my case, anyway), such as the TextMesh component.
    Additionally, I seem to be having a problem deserializing multiple instances of the same prefabs; I get the error "ArgumentException: An element with the same key already exists in the dictionary." and only one instance of each prefab will deserialize. Any help on how to fix this would be appreciated.
     
  6. Jaymian

    Jaymian

    Joined:
    Jul 11, 2014
    Posts:
    4
    After upgrading to the latest version, I'm now having this problem as well, even though I have "IsPrefab" set to true, it's not generating new serialID's on instantiation anymore, any help would be appreciated.
     
    thiruda likes this.
  7. Egnech

    Egnech

    Joined:
    Aug 27, 2015
    Posts:
    27
    Good day everyone!

    First of all, I want to say that RS asset is great! Thank you developers!
    Now I'm working on checkpoint system for my game, and this asset helps me a lot!

    It would be great if anyone could help me to get one thing.

    I need to serialize certain game objects in a scene. So I don't need to add an UIDSystem script to every object, am I right?

    But if I add UIDSystem to root game object, how can I prevent it to be added to each children object? It becomes very boring to remove this component where it is useless.
     
  8. Charles-Van-Norman

    Charles-Van-Norman

    Joined:
    Aug 10, 2010
    Posts:
    86
    Hi -- I'm trying to decide whether to buy this product. I do not need scene serialization, but rather I have a nested array of a class and subclass which I want to serialize .. but using Unity's serialization doesn't work with the enums inside the class (the enums are reset to their default values on Builds, but they work fine in the Editor!)

    Will this product solve my issue (being able to have nested, serializable, custom classes where the data I save in my hierarchy before a build will persist into the build)?

    Thank you
     
  9. Julien-Lynge

    Julien-Lynge

    Joined:
    Nov 5, 2010
    Posts:
    142
    I've been checking out the forum thread - looks like a cool tool!

    I'm with @Duffer123 - what I really need to be able to do is to serialize out the references to assets at runtime, rather than serializing and deserializing a binary blob of the assets. Like Duffer, I need to be able to serialize changes to materials that happen at runtime, where colors, materials, and other fields will be adjusted by the user via various customization interfaces.

    This seems like a really difficult problem. Unity doesn't appear to make its internal GUIDs available to the user at runtime, and tools like ShaderUtils that can return all asset references from a material are in the UnityEditor namespace. If you ever solve this problem, it would be a very powerful tool :)
     
  10. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    Could we have some sort of simple tutorial posted up please? Something where you set up a save and load menu where you're loading up a simple cube just so we have reference to look at for more complicated scenes?
     
  11. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Hey, looks quite promising.
    Is your Asset able to (de)serialize the state of running coroutines? If not is this feature planned or out of scope?
    Thanks for your time.
     
  12. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi, I've been using this plugin, and it works smoothly in my project. However could you provide a dll version, because the source files are too many, which makes my project view not compact. Thanks!
     
  13. aaronjbaptiste

    aaronjbaptiste

    Joined:
    Dec 4, 2012
    Posts:
    53
    Hi,

    Is there a way to do a non-destructive deserialization? For example I have a World object that contains a Terrain object. The terrain stores many things but I only want to serialize a single field - terrainChanges.

    Currently if I serialize the world and then immediately deserialize it back, the Terrain object is created anew and it only has data pertaining to the field terrainChanges, the other fields are made null. It would be great if only terriainChanges were updated and the other fields kept their previous values.

    You can do this at the top level, when calling RSManager.Deserialize you can pass the object you want the data to be appended to and it makes it non-desctructive, but this doesn't trickle down to sub properties.

    I also tied creating a custom Serializer, I thought maybe something like:

    _info.GetValue<Terrain>("terrain", _terrain);

    would work, but this option isn't available. Any ideas?

    Thanks
     
  14. azhr89

    azhr89

    Joined:
    Jul 10, 2015
    Posts:
    3
    Hi @Voxel Busters

    So I tried the free version first and then bought this paid Asset and imported it. I am getting the following error:
    Assets/VoxelBusters/RuntimeSerialization/Scripts/Manager/RSManager.cs(399,59): error CS0117: `Constants' does not contain a definition for `kSerializationSupportedFormatVersions'

    I am unable to find this defined constant. Any ideas?
     
  15. azhr89

    azhr89

    Joined:
    Jul 10, 2015
    Posts:
    3
    Doesn't matter, I had a C# script with the same name Constants.cs which was getting referenced. I solved the issue by prepending the VoxelBusters namespace:
    VoxelBusters.RuntimeSerialization.Internal
     
  16. azhr89

    azhr89

    Joined:
    Jul 10, 2015
    Posts:
    3
    Doesn't matter, I had a C# script with the same name Constants.cs which was getting referenced. I solved the issue by prepending the VoxelBusters namespace:
    VoxelBusters.RuntimeSerialization.Internal
     
  17. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    Cool, thanks for the update. Even we guessed that classname conflict might be causing this issue.
     
  18. SoullessDreamer

    SoullessDreamer

    Joined:
    May 13, 2014
    Posts:
    1
    Hello, I was wondering if someone could help me. I am wracking my brain trying to figure out what I am doing wrong.
    I am trying to get a list of mine to serialize. It works to the point of where it saves the list length and the type of list it is. However every parameter of the list is empty. Thank you in advance for the help!

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using System;
    5. using VoxelBusters.RuntimeSerialization;
    6.  
    7. [RuntimeSerializable(typeof(MonoBehaviour), false)]
    8. public class PlayerSavedSettings : MonoBehaviour
    9. {
    10.  
    11.     public Vector3 spawnPointSave;
    12.  
    13.     public GameObject thePlayerInventoryCanvas;
    14.  
    15.     public GameObject thePlayerQuickPanelCanvas;
    16.  
    17.     [RuntimeSerializeField]
    18.     public List<TheBigListOfInventoryQuickInv> namesOfObjectsToAddToInventory = new List<TheBigListOfInventoryQuickInv>();
    19.  
    20.     [RuntimeSerializeField]
    21.     public List<TheBigListOfInventoryQuickInv> namesOfObjectsToAddToQuickPanel = new List<TheBigListOfInventoryQuickInv>();
    22.  
    23.     // Use this for initialization
    24.     void Start ()
    25.     {
    26.         thePlayerInventoryCanvas = GameObject.Find("LoadSaveGameOnLevelLoad").GetComponent<CheckThenLoadSave>().thePlayerInventoryCanvasStatic;
    27.         thePlayerQuickPanelCanvas = GameObject.Find("LoadSaveGameOnLevelLoad").GetComponent<CheckThenLoadSave>().thePlayerQuickPanelCanvasStatic;
    28.     }
    29.  
    30.     // Update is called once per frame
    31.     void Update ()
    32.     {
    33.  
    34.     }
    35.  
    36.     public void GetPlayerInfoAndActivateSave()
    37.     {
    38.         thePlayerInventoryCanvas.SetActive(true);
    39.  
    40.         namesOfObjectsToAddToInventory.Clear();
    41.         namesOfObjectsToAddToQuickPanel.Clear();
    42.  
    43.         foreach (GameObject item in thePlayerInventoryCanvas.GetComponent<Inventory>().slots)
    44.         {
    45.             if (item.GetComponentInChildren<ItemBehavior>())
    46.             {
    47.                 namesOfObjectsToAddToInventory.Add(new TheBigListOfInventoryQuickInv(item.GetComponentInChildren<ItemBehavior>().item.ID.ToString(), item.GetComponentInChildren<ItemBehavior>().amount));
    48.             }
    49.         }
    50.  
    51.         foreach (GameObject item in thePlayerQuickPanelCanvas.GetComponent<Inventory>().slots)
    52.         {
    53.             if (item.GetComponentInChildren<ItemBehavior>())
    54.             {
    55.                 namesOfObjectsToAddToQuickPanel.Add(new TheBigListOfInventoryQuickInv(item.GetComponentInChildren<ItemBehavior>().item.ID.ToString(), item.GetComponentInChildren<ItemBehavior>().amount));
    56.             }
    57.         }
    58.         thePlayerInventoryCanvas.SetActive(false);
    59.         GameObject.Find("AllGameObjects").GetComponent<VoxelBusters.RuntimeSerialization.Main.RuntimeGameObjectsToSave>().Serialize();
    60.     }
    61. }
    62.  
    63. [RuntimeSerializable(typeof(MonoBehaviour), true, true)]
    64. [System.Serializable]
    65. public class TheBigListOfInventoryQuickInv
    66. {
    67.     public string idFromSave;
    68.     public int amountForEachItem;
    69.  
    70.  
    71.     public TheBigListOfInventoryQuickInv(string itemName, int itemAmount)
    72.     {
    73.         idFromSave = itemName;
    74.         amountForEachItem = itemAmount;
    75.     }
    76.  
    77. }
    78.  
     
  19. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    @SoullessDreamer
    We have replied to you from our support mail.

    Thanks,
    VB Team
     
  20. Oniony

    Oniony

    Joined:
    Aug 15, 2013
    Posts:
    31
    Adding:
    Code (CSharp):
    1. namespace VoxelBusters.RuntimeSerialization.Demo{
    2.  
    3.     [RuntimeSerializable(typeof(MonoBehaviour), false)]
    4.  
    5. }
    ss (2016-07-13 at 11.10.24).png
    to a C# script makes it possible to serialize the script if it is on a gameobject.

    But how do I do this with a js script?
     
  21. superventure

    superventure

    Joined:
    Sep 14, 2012
    Posts:
    8
    I purchased the asset and this is not very easy to use.... I have no idea on how to integrate this with my current scenes. I do not write in C, only in js, but I thought it would at least be plug n play to some degree because of how 'extremely easy it is to use' . Maybe I'm missing something?

    I was hoping I could just place all of my specific game objects (the player, items, team mates, etc) in an master game object with any necessary saving scripts on it/them and save the master object. I could make a master save object in every scene if I have to, unless if it could work out that I could put a 'don't destroy on load' code on the master and port it with me between scenes.


    either way if this is possible, is there any way you could give me a simplified script to do this with? All I need is a dump object I can place in any scene that saves all of its children and simple save/load gui buttons.

    Thank you
     
  22. aaronjbaptiste

    aaronjbaptiste

    Joined:
    Dec 4, 2012
    Posts:
    53
    It's worth noting that the blog with the tutorials is also down and cannot be accessed.
     
    Lethn likes this.
  23. R3D0

    R3D0

    Joined:
    Sep 24, 2014
    Posts:
    6
    I'm having trouble finding documentation on how the Scene serializer works?
    What I wish to use it for, if possible:
    I have a game scene with approximately 150-200 GameObjects. The hope is to take a "snapshot" of the scene when the player saves, and restore it when they load the save file.
    Is this possible with this plugin, or am I misunderstanding what you mean by Scene Serialization?
     
  24. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    I'd like to know about assetBundle support and 'Scene Serialization'
    i.e I have scenes my users download via asset bundles, they change alot of parameters in these scenes, including the color/ metallic/gloss/textures of materials in the scene.
    Then they should be able to 'save' this and send it to another user to view

    does that sound possible?
     
  25. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    Did try with this kind of data:

    Code (CSharp):
    1.    
    2.  
    3. [System.Serializable]
    4.     public class _leaderData
    5.     {
    6.         public string Name;
    7.         [HideInInspector]
    8.         public int leaderNro;
    9.         public Sprite face;
    10.         public Texture faceTexture;
    11.         public StaticData._player_unit Owner;
    12.         public bool active;
    13.         public bool attacking = false;
    14.         public bool cancel = false;
    15.         public bool canceling = false;
    16.         public bool selected = false;
    17.         public int axes;
    18.         public int bows;
    19.         public int swords;
    20.         public int cavalry;
    21.         public int cannons;
    22.         public int catapults;
    23.         public int habitat;
    24.         public GameObject currentHome;
    25.         public int currentHomeID;
    26.         public GameObject leaderObject;
    27.         public int leaderID;
    28.         public GameObject stationObject;
    29.         public int stationID;
    30.         public GameObject attackObject;
    31.         public bool attackAddress = false;
    32.         public Vector3 attackPoint;
    33.         public Vector3 startPoint;
    34.         public float position_x;
    35.         public float position_y;
    36.         public float position_z;
    37.         public float rotation_x;
    38.         public float rotation_y;
    39.         public float rotation_z;
    40.     }
    41.  
    42.     [System.Serializable]
    43.     public class _leaderGroups
    44.     {
    45.         public StaticData._player_unit Owner;
    46.         public bool LOCAL;
    47.         public List<_leaderData> leaderData = new List<_leaderData>();
    48.     }
    49.  
    50. public List<_leaderGroups> leaderGroups = new List<_leaderGroups>();
    51.  
    52.  
    53. ......
    54. RSManager.Serialize<_leaderGroups>(leaderGroups, "any-unique-id", eSaveTarget.PLAYER_PREFS);
    55. ......
    56. leaderGroups = RSManager.Deserializee<_leaderGroups>("any-unique-id");
    57. ......
    58.  
    Didn't work. When trying to load saved data:

    NullReferenceException: Object reference not set to an instance of an object
    GameMenu+<InstantiateLoaded>c__Iterator28.MoveNext () (at Assets/GameAssets/Scripts/GameMenu.cs:87)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

    With json.net I can use similar way to save data. Works perfectly, BUT NOT WITH WEBPLAYER, what I need urgently. WebGL sucks now and forever.

    What I'm missing here?


    FORGET. SOLVED.

    RTFM from web helped with this problem..... but!
     
    Last edited: Oct 21, 2016
  26. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    I have another one immediatelly. I save and load data with secureplayerprefs as:


    Code (CSharp):
    1.  
    2.  
    3. string json = SecurePlayerPrefs.GetString("Level_" + levelname, "testipassi");
    4. levelData = RSManager.DeserializeData<_levelx>(json);
    5.  
    6. //and
    7.  
    8. string json = RSManager.Serialize<_levelx>(levelData);
    9. SecurePlayerPrefs.SetString("Level_" + levelname, json, "testipassi");
    10.  
    Securex do what it should be. No any errors between save/load. Exactly identical string.

    BUT!!! RuntimeSerialization sucks. When saving and loading with SAME build, everything work just fine.

    BUT! When compiling a new version. Unity's original JSON do exactly same error. Unusable right now! :mad:

    TypeLoadException: Could not load type 'System.Collections.Generic.List`1[[LoadSave+_building, Assembly-CSharp, Version=0.1.6138.40819, Culture=neutral, PublicKeyToken=null]]'.
    System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError, Boolean ignoreCase) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:398)
     
    Last edited: Oct 22, 2016
  27. cre8ivepark

    cre8ivepark

    Joined:
    Oct 21, 2016
    Posts:
    4
    Hi VoxelBusters,
    I have purchased Runtime Serialization from Unity Asset Store and I have some questions. (I am new to Unity/C#, below might involve some basics of Unity/C#)


    I am trying to apply to my HoloLens app project to save and load a scene. It just have an UI Canvas and multiple UI Text objects inside it. Users can add or manipulate text objects. I would like to save and load these layout of the text in the scene.





    I have been looking at SceneSerializationDemo and trying to find the elements that I should apply to my scene.


    So far I have done:

    1. I have created a script (SceneSaveLoadManager.cs code below) and added it to the UI Canvas (which is the root of my all UI text content)
    2. I also have added UID System script to the UI Canvas


    Now I guess all I have to do is call sceneSaveLoadManager.Serialize() to save the scene and SceneSaveLoadManager.Deserialize() ?


    When I try to build the app, it gives me this error:
    Assets\VoxelBusters\RuntimeSerialization\Benchmark\Scripts\Profiler.cs(6,36): error CS0234: The type or namespace name 'Formatters' does not exist in the namespace 'System.Runtime.Serialization' (are you missing an assembly reference?)


    The build setting is ‘Windows Store’ (Windows 10) since HoloLens apps are packaged as UWP.


    ---------------------------------------------

    SceneSaveLoadManager.cs : This is the code I have added to the UI canvas object that I want to save including its child objects
    ---------------------------------------------
    using UnityEngine;
    using System.Collections;
    using VoxelBusters.RuntimeSerialization;


    namespace HoloToolkit.Unity
    {
    [RuntimeSerializable(typeof(MonoBehaviour), false)]
    public class SceneSaveLoadManager : MonoBehaviour
    {


    private const string kSerializationIDForFiles = "type-inspector-files";




    public void Serialize()
    {
    RSManager.Serialize<SceneSaveLoadManager>(this, kSerializationIDForFiles, eSaveTarget.FILE_SYSTEM);
    }


    public void Deserialize()
    {
    //Clear();
    RSManager.Deserialize<SceneSaveLoadManager>(kSerializationIDForFiles);
    }
    }
    }


    Below Main.cs is the place where I want to call Deserialize() to restore the scene.
    I am also getting an error when I have [SerializeField] below. If I remove it, it does not generate errors.



    ---------------------------------------------

    Main.cs : This is the code where I want to invoke Deserialize or Serialize

    ---------------------------------------------

    using UnityEngine;

    using System.Collections;
    using VoxelBusters.RuntimeSerialization;


    namespace HoloToolkit.Unity
    {
    public class MainLogic : MonoBehaviour
    {
    [SerializeField]
    private SceneSaveLoadManager sceneSaveLoadManager;


    // Use this for initialization
    void Start()
    {
    Debug.Log("******************** MainLogic : sceneSaveLoadManager.Deserialize() *********************************");


    sceneSaveLoadManager.Deserialize();
    }
    }
    }
     
  28. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    It seems, that Voxel can't serialize inner List<t> properly!

    I made a little test with this:

    Code (CSharp):
    1.  
    2. [Serializable]
    3.     [RuntimeSerializable(typeof(_tree), true)]
    4.     public class _tree
    5.     {
    6.         #region Fields
    7.         public string assetName;
    8.         public string visibleName;
    9.         public float assetPosition_x;
    10.         public float assetPosition_y;
    11.         public float assetPosition_z;
    12.         public float height;
    13.         public float spread;
    14.         public float rotation;
    15.         public bool permanent;
    16.         public int healt;
    17.         #endregion
    18.     }
    19.  
    20.     [Serializable]
    21.     [RuntimeSerializable(typeof(_levelx), true)]
    22.     public class _levelx
    23.     {
    24.         #region Fields
    25.         public string Version = "1.0.0.0";
    26.         public int itemsToInstantiate;
    27.         public bool crypted;
    28.  
    29.         [NonRuntimeSerializedField]
    30.         public List<_building> buildings = new List<_building>();
    31.         [NonRuntimeSerializedField]
    32.         public List<_storage> storages = new List<_storage>();
    33.         //[NonRuntimeSerializedField]
    34.         public List<_tree> trees; // = new List<_tree>();
    35.         [NonRuntimeSerializedField]
    36.         public List<_slroad> roads; // = new List<_slroad>();
    37.  
    38.         #endregion
    39.     }
    40.     //#region Fields
    41.     public _levelx levelData; // = new _levelx();
    42.     //#endregion
    43.  
    44.  
    In _levelx class, I turned ALL List<t> fields off and saved data. I modified code elsewhere and
    compiled a new version of progam. Ok, everything worked just fine. No errors and data remained.

    WHEN I enabled serialization for List<_tree> trees, then everything starts go wrong. Inside SAME build,
    data remains, but if I made any changes anywhere in my code, I can't load data anymore. And I got
    this error with modification above:

    TypeLoadException: Could not load type 'System.Collections.Generic.List`1[[LoadSave+_tree, Assembly-CSharp, Version=0.1.6139.35944, Culture=neutral, PublicKeyToken=null]]'.
    System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError, Boolean ignoreCase) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:398)

    So, how the hell fix this?:mad:

    FORGET!
     
    Last edited: Oct 24, 2016
  29. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    What a surprise. I did try unitys original JSonUtility's tojson and fromjson routines. It seems,
    they work right now as required!

    When Unity fixed that? I remember, that I fight with them year or two ago too much.

    Hovewer, I don't need anymore 3rd party json/de-/serializers. Unity did it!
    Full hierarchy at once. No problems with new builds either. I'm satisfied.
     
  30. bwheatley

    bwheatley

    Joined:
    Jun 23, 2012
    Posts:
    45
    Just stopping back in guys. It's been more than a year, I just wanted to see how the progress on the re-write was going? I hope this hasn't become abandonware. :'(
     
  31. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @Voxel-Busters ,

    Is this asset still supported? Does it still work? Can it still save and load complex gameobjects? With Unity 5.5 and 5.6?
     
  32. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    @Voxel-Busters

    This asset looks like the most improved JSON serializer for Unity, but without support...
     
  33. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    Tutorial isn't opening

     
  34. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
  35. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    (update: I figure it out. If you click "How to serialize objects (Part 1)" on left side of the page, it works. But "How to serialize objects (Part 1)" in the middle leads to a dead page.)
    But your link leads to same page and as soon as I click How to serialize objects (Part 1) I end up in a same place with a the same link.
     
  36. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    Please check here. The tutorials link was updated longtime. Not sure if we have dead links somewhere.

    Sorry for the delay. Didn't notice the notification.

    Thanks,
    VB Team
     
  37. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    @Gua : Got it! Will fix those old links!
     
  38. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    93
  39. yaffa

    yaffa

    Joined:
    Nov 21, 2016
    Posts:
    41
    Is there a way to pass Serialised data between devices ?
     
  40. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    Yes, you can do that. Instead of using serialization with inbuilt saving mechanism, you need to serialize object as string and pass it to your other device and deserialize using that data.

    Please check the car example in this tutorial post: https://tutorials.serialization.voxelbusters.com/how-to-serialize-objects-part-1.html It should give you clarity about whats being said above.
     
  41. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    Apologies for late reply. Above said component is not supported in the current version. However, you can create your own custom extensions and extend support to required classes.

    Please check this post: https://tutorials.serialization.voxelbusters.com/how-to-serialize-objects-part-2.html to understand how extension classes can be implemented.
     
  42. yaffa

    yaffa

    Joined:
    Nov 21, 2016
    Posts:
    41
    Hey , thanks for the quick reply.. was wondering if you can point me toward how to send and receive this serialised data between devices? Like do i have to use Gamesparks and all?
     
    Last edited: Aug 7, 2017
  43. thiruda

    thiruda

    Joined:
    Jul 7, 2015
    Posts:
    3
    Im having the same issue..
     
  44. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    Thanks for reporting the issue, we will schedule a test and get back to you at the earliest possible.
     
  45. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
    This is specific to your application. I suggest you to sync the string output either using Cloud Service or by implementing custom server operation.

    For playerprefs like cloud service, you can consider our native plugin CPNP: http://u3d.as/bV0
     
  46. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    192
    Hi there .
    Im new with runtime serialization, what i want to do is save and load a list of gameobjects. Each go contain some components(mesh render, mesh collider ... and some 3 customes scriptes).
    RMmanger.serialise work well but when he find a componenet that is not serialisable it not work (for example child of GO that have text mesh as components).

    So my question is how can avoid Runtime serialization from serialise those componenet, and how i can add avoided components to deserialsed GO. (GO.AddComponenet <>).


    Public List <GameObject> Objects = new list<GameObject>();

    GO.......Transform
    . Mesh
    . MeshRender
    . Classe1 and Classe2

    Child of GO..... textMesh
    .......another Comp

    Thanks for any help.
     
  47. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,463
    Hi,
    Will this asset be able to save/serialize gameobjects that contains a mesh/collider/material/script for later loading? Thanks for your confirmation.,
     
  48. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    192
    This asset is powerful you can see supported type. In addition to that you can serialize your custom scriptes.
    I found it very hard first but now i can serialize 90% of my data.
     
  49. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,463
    Hi sisocano, many thanks for the info, much appreciated. Do you have a sample script on how to serialize a gameobject just to see how it is done? Is is simple enough?
     
  50. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    192
    Hi there.
    Yes you may just need to add UIDsystem.cs to your gameobject
    This scripte will recover all components on your gameobject automa..
    If you have scripte_01 ...etc (custom scriptes ) add this befor public class
    [RuntimeSerializable(typeof(MonoBehaviour ), true)].

    Now to save your gameobject :
    If(getkeydown) ....
    RSManager.Serialize<GameObject>(yourGO,"FileName", eSaveTarget.FILE_SYSTEM);
    }

    To load it again
    RSManager.Deserialize<GameObject>("FileName);