Beispiel #1
0
		public static bool LoadToolsFromDirectory(string folderPath, out List<HEU_ShelfToolData> tools)
		{
			tools = new List<HEU_ShelfToolData>();

			string[] filePaths = HEU_Platform.GetFilesInFolder(folderPath, "*.json", true);
			bool bResult = false;
			try
			{
				if (filePaths != null)
				{
					foreach (string fileName in filePaths)
					{
						HEU_ShelfToolData tool = LoadToolFromJsonFile(fileName);
						if(tool != null)
						{
							tools.Add(tool);
						}
					}

					bResult = true;
				}
			}
			catch(System.Exception ex)
			{
				Debug.LogErrorFormat("Parsing JSON files in directory caused exception: {0}", ex);
				return false;
			}

			return bResult;
		}