playcanvas / playcanvas/engine
SpriteComponents always load their Sprite assets even when disabled and not preloaded?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Description
While investigating why I had too many assets loaded I discovered that sprite component (simple and animated) load their associated sprite and textureatlas event when they are disabled and the assets are not preloaded.
This behavior is different from the similar image component that will not load their assets when they are already disabled at launch.
- Sample project https://playcanvas.com/project/695291/overview/spriteloading
- Tested with platform(s): Windows 10 (64-bit) / browser(s): Chrome Version 83.0.4103.106 (64-bit)
- Forum thread: https://forum.playcanvas.com/t/spritecomponent-always-loaded-event-when-disabled-and-not-preloaded/13683
Steps to Reproduce
- Open sample project and notice all graphics node are disabled and assets are not preloded.
- Launch sample project and notice the scene is empty.
- Open console and notice logs about all assets used by sprites components been loaded.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked sample project and reproduce the console asset-loading logs described in the issue. Trace the sprite component asset-loading path and compare it with the disabled image component behavior; done means disabled, non-preloaded sprite components do not load their sprite or texture atlas assets at launch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100