-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Particles are not copied when building for Web Desktop #605
Comments
Thanks ggarek |
Wait, this is by design, not a bug. Only assets under
|
@jareguo I created new project from scratch to check it once again. I think there is a though, let me put some more details about it. First of all, this thing is not correct
because the
then to get the correct url to var url = cc.url.raw("textures/mytexture.png"); Regarding the bug. I create a project, add particle resource, then drag the particle file to the scene in Cocos Creator. In this case both files (.plist and .png) are copied to the build directory. But, when i add a particle to Assets in Cocos Creator, then i create the ParticleSystem in runtime, like this: start: function () {
const node = new cc.Node();
const ps = node.addComponent(cc.ParticleSystem);
ps.file = cc.url.raw('/particles/fire-parts.plist');
node.setPosition(200, 200);
cc.director.getScene().addChild(node);
}, It works in development mode, but when i build the project, the Here is the assets dir listing:
And here is the build dir listing:
As you can see, |
As mentioned above, only assets under assets/resources directory will be copied to the output directory. |
Ok, i tried to put the .plist and .png which i use to create ParticleSystem dynamically under Still it seems not very convenient. If i create a node via editor then the resource files are copied to the build directory no matter the path, but if i do it dynamically, then i need to put it under a specific path. Anyways, thanks for the explanation! |
Yes there will be a hint in the future, thanks for the feedback ~~~ |
Hello,
I built a small project with Cocos Creator. And when i tried to build it for web desktop i found out that not all assets get copied. I have a
.plist
and.png
underassets/particles
, but they are absent in build directory.When i copy them to the build directory under
build/web-desktop/res/raw-assets/particles/
everything works as expected.The text was updated successfully, but these errors were encountered: