Thank you again for the reply, Andres_IC, but please check my code and you will see that I do not have resources in the path and it does not have “.jpg” in the end either:
Ok, I invested some more time and found a way to reproduce this behavior.
In your example, make your TestLoading class executable in edit mode. Setup a getter and a setter for some property and, in the setter, try to load the resource. It will not find it, but in runtime, it does.
Why are you doing that?the purpose of dinamic load is to do it in runtime not in editor.
If you want to make it in editor you must investigate how to extend the editor
Oh, because I want to be able to configure objects, sprites and so on, all in design time while seeing how that would be visually and that means loading things dynamically, right?
This one was a simple example: changing the background image based on a property value which is an enum, as you may have guessed (the Hero one). I want to be able to see this happen in design time, not in runtime.
Another approach I would try was to create an array property of a class which stores an Id (number) and a SpriteFrame.
Anyway, I don’t think I would be extending the editor; just using its own resources. Well, I admit I am doing this because it is pretty common to do it in other IDEs as they offer this support without extending it, but maybe there is a better way in Cocos Creator. Any suggestions?