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. Dismiss Notice

File Management and IO

Discussion in 'Scripting' started by ALaster34, Jun 25, 2018.

  1. ALaster34

    ALaster34

    Joined:
    Mar 20, 2012
    Posts:
    21
    If anyone has a moment to discuss json and Unity I'd like to discuss some topics.
    I've taken some tutorials and searched the web; however of all the topics to learn Unity this one doesn't seem to have a large credible group that shows examples that don't break or don't seem like a good approach.
    I'm willing to pay for a one on one and I guarantee it wont take long. This just doesn't seem to be a topic discussed much.
    I can facebook message skype or any number of ways to go over this topic.
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
  3. ALaster34

    ALaster34

    Joined:
    Mar 20, 2012
    Posts:
    21
    Yes sir I have completed how to save and load basic data.
    I was wanting to use json like a database to load in strings in an array like a name or item generator.
    Every example from youtube or other examples were either convoluted or broken.
    My issue is that all I need is the json file to load elements of my "large" array into a game object so then I can randomize a list of items or names then when a player selects an NPC or item it can be saved from there.
    Ive seen plenty of examples using a text file but I don't want to use text file. No reason to form bad habits and json seems to be the way everyone is going opposed to xml
     
  4. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    I'm pretty sure you can put a string array or list into a class, and save that class to/from json, with JsonUtility.
     
  5. ALaster34

    ALaster34

    Joined:
    Mar 20, 2012
    Posts:
    21
    Can you please point me to a good example or tutorial
    I believe you and im willing to learn
     
  6. NetherChef

    NetherChef

    Joined:
    Apr 2, 2018
    Posts:
    15
    Try this. Hope it helps!
     
    ALaster34 likes this.
  7. ALaster34

    ALaster34

    Joined:
    Mar 20, 2012
    Posts:
    21
    Thank you Nether I had already tried that one and for some reason it didn't work when I got to an array of a single type. Unless Im doing Json wrong but I don't think so since I used another approach by another youtube tutorial.
    Example:
    {
    "names":
    [
    "Adam", "Brian", "Chris", "David", "Ethan"
    ]
    }

    Its ok though ive found a work around for now I just hoped that someone would have a little time for a one on one.
    Even my Udemy classes never really touched on json files. What Im wanting to do is probably not a common practice anyways.
     
  8. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    I watched the video linked and it seemed straight forward and correct.
    Are you sure you put all the same steps?

    If you're still stuck, could you upload a simple repro unity package with just the relevant code -- maybe someone could look at it for you (maybe me), and see if they spot something wrong.
     
    ALaster34 likes this.
  9. LForward1

    LForward1

    Joined:
    Jul 22, 2019
    Posts:
    12
    I have a couple of questions regarding file management. The fact is that I began to think about how to optimize the work of my sales department and for this I need special software for sorting files and data of different classes. We tried to use various free services, but the number of errors in such services is simply amazing. Recently, I was advised to use the services of intelligencebank.com and said that they are market leaders in Digital Asset Management Software ... I would like to know if anyone here worked with these guys?
     
    Last edited: Feb 13, 2020