LeakzLP Posted July 15, 2019 Share Posted July 15, 2019 Hello ,i have a problem my VehicleData.json can't load , but i don't know why ? I've put this file in Database/VehicleData.json class Vehicles : Script{ public static List<VehicleData> vehicleDataList = new List<VehicleData>(); public void LoadVehicleData() { if (!File.Exists(@"./Database/VehicleData.json")) { NAPI.Util.ConsoleOutput("[JSON] VehicleData konnte nicht geladen werden!"); return; } string[] result = File.ReadAllLines(@"./Database/VehicleData.json"); for(int i = 0; i < result.Length; i++) { VehicleData vehicleData = NAPI.Util.FromJson<VehicleData>(result[i]); vehicleDataList.Add(vehicleData); } } I put my Database folder into resources/myProject/Database/VehicleData.json Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now