Esempio n. 1
0
    // Loads the items from json
    private ItemDatabaseList LoadItemsFromFile()
    {
        string _filePath = Path.Combine(Application.streamingAssetsPath, itemDataFileName);

        if (File.Exists(_filePath))
        {
            string           dataAsJson   = File.ReadAllText(_filePath);
            ItemDatabaseList databaseList = JsonUtility.FromJson <ItemDatabaseList>(dataAsJson);
            return(databaseList);
        }
        return(null);
    }
Esempio n. 2
0
 private void Start()
 {
     itemDatabaseList = GameObject.Find("ItemDatabaseList").GetComponent <ItemDatabaseList>();
 }