How to load config data from JSON file in HelloWorld?

Hi, camel_liu~
For examle , you can put your json file in res folder.
And use cc.loader in your code like:

cc.loader.loadJson("res/example.json",function(error, data){
    cc.log(data);// data is the json object
});
1 Like