Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JSON FILE
- {
- "technologies" : [
- {
- "naming":"factory" ,
- "shortDescription":"Building that creates cars or bots." ,
- "longDescription":"Using this building..." ,
- "allows":["mechbay","airbay"]
- } ,
- {
- "naming":"mechbay" ,
- "shortDescription":"Building that creates mechs." ,
- "longDescription":"Assemble your mechs here..." ,
- "allows":["satellite"]
- }
- ]
- }
- // CODE FOR LOADING
- [System.Serializable]
- public class HolderClass
- {
- public string naming;
- public string shortDescription;
- public string longDescription;
- public List<string> allows = new List<string>();
- }
- public class TechTreeDataLoading:MonoBehaviour {
- List<HolderClass> allHolders = new List<HolderClass>();
- void Start()
- {
- StreamReader sr = new StreamReader(Application.dataPath + "/Resources/skilltree/knowledgetree.json");
- allHolders = JsonUtility.FromJson<List<HolderClass>>(sr.ReadToEnd());
- sr.Close();
- Debug.Log(allHolders.Count + "| COUNT ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement