cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.23k stars 1.94k forks source link

When dynamically loading the folder bundle, neither texture nor texturecube can get names #16185

Open jk20012001 opened 1 year ago

jk20012001 commented 1 year ago

Cocos Creator version

3.8.1

System information

Win10

Issue description

image If you can't get a specific texture from a bundle with asset.name, you must use "skybox" as name:

企业微信截图_f2153306-7749-4dd0-b5f6-63860d1972de(1)

use "skybox" can only get .png .jpg. If you use .hdr as cubemap, you get null from bundle asset

Relevant error log output

No response

Steps to reproduce

  1. create bundle folder, and copy .hdr or .png file
  2. use script to load bundle and get texture

Minimal reproduction project

No response

SantyWang commented 1 year ago

Texture type resources don't have serialized names, so they don't have names. If you need a name, you need to save it in the serialization and deserialization functions.

SantyWang commented 1 year ago

image Need to save name in serialization function