I created a json file to store Unit data for one of Scenes, right now it is stored in data/warfare/ folder under the name Units.json.
I added the following code to my Scene, and it loads the data as it should:
What I tried first was:
So my question is:
Is it fine as it is, can I fix the Lihinel.Warfare... part, or do I have to write my own methods for loading data if I want to put it into the "Lihinel" object?
I added the following code to my Scene, and it loads the data as it should:
However, it doesn't conform with the information hiding scheme of putting everything into my "Lihinel" object that hides classes and scenes from the outside. I did use '$lihinelWarfareUnitBaseData' instead of just '$warfareUnitBaseData' to reach some middleground of preventing conflicts with other scripts.DataManager._databaseFiles.push({ name: '$lihinelWarfareUnitBaseData', src: 'warfare/Units.json' })
What I tried first was:
but that just leads to Lihinel.warfareUnitBaseData being undefined, I guess its because it treats the entire thing as a string and tries to add that as a variable to window, but I am not entirely sure.DataManager._databaseFiles.push({ name: 'Lihinel.warfareUnitBaseData', src: 'Units.json' })
So my question is:
Is it fine as it is, can I fix the Lihinel.Warfare... part, or do I have to write my own methods for loading data if I want to put it into the "Lihinel" object?
