nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.1k stars 143 forks source link

How can I change the asset Container? #233

Open Sokolargm opened 1 year ago

Sokolargm commented 1 year ago

I need to put "MapPackage" to the Texture2D and Sprite to make it work in the game. image

nesrak1 commented 1 year ago

Are these textures supposed to be loaded with a different name or under MapPackage? If the game is only looking for MonoBehaviours with that name, then it isn't going to read your Texture2D and sprite with that container name. Instead, look to see if the MonoBehaviours have references to a texture or sprite.

If you truly need to set the container strings, you can do that by editing the AssetBundle asset.

Sokolargm commented 1 year ago

I added my assets here image and it has been updated here image but in Asset Studio it's empty image

nesrak1 commented 1 year ago

So... does it do what you want in game or not? What are you trying to do?

Sokolargm commented 1 year ago

I tested it in the game and it didn't work I also tried to change the Container for another bundle, but when checking in Asset Studio, the container did not change

nesrak1 commented 1 year ago

I don't even know what you're trying to do. Very often people think that they want to edit the container but in reality it's not going to do anything extra at all. The container is the path name used when loading assets from C#, and if the code isn't setup to read assets of this type and name, it's not gonna work. I notice your game is Switch, so I'm assuming you're just guessing that the code does this without actually knowing.

but when checking in Asset Studio, the container did not change

I didn't write Asset Studio so I don't know why it would be doing this. However, I would double check you are actually saving the bundle here. If you add those lines in the container, it's not like UABEA just decides not to write sometimes. I would try closing UABEA fully and reopening the bundle to see if the container is still in the file. Otherwise, you didn't save the bundle at all.

It's also possible that AssetStudio has a bug where it's not showing the container properly. I doubt this, but in this scenario I would just ignore it.

Sokolargm commented 1 year ago

I changed the AssetBundle and saved it, then I saved the whole bundle and re-opened it in the UABEA, container param was changed. I don't really know why I'm sure the game only loads everything that has a MapPackage parameter (possibly because all files have such a container), I tried to create a bundle through unity, but I only managed to set the value "mappackage" to the container and I need "MapPackage". I also tried not to set the container, but my asset did not appear in the game

nesrak1 commented 1 year ago

Do these bundles usually have textures or sprites? You haven't given me quite enough information about what you're trying to do, so I'll just guess that you want to change a map's preview icon or something. In that case, I would open an original bundle and see if the original textures have been referenced by a monobehaviour (i.e. using the path id of the texture/sprite in the monobehaviour dump.)

Sokolargm commented 1 year ago

Now I'll try to explain it to you. There is a series of Just Dance games and this year they switched to the Unity engine. They started using AssetBundle to store song files, they also use their private programs to create a bundle using unity. All files have a Container "MapPackage", files with the type "MonoBehaviour" contain information about the song (lyrics, song timings, etc.). Through your program, I deleted all Sprite and Texture2D files. Then I added new files via File -> Add, I specified the desired Typename and PathID. But in order for the game to load my added files, I need their Container to be "MapPackage", I tried to do this, but as you can see, for some reason I can't do it. Here is three bundles of one song (map) if you need it: https://cdn.glitch.global/038fa3ae-8a76-4f32-bfa2-022c3ef3edb0/CoachesLarge?v=1680531652282 https://cdn.glitch.global/038fa3ae-8a76-4f32-bfa2-022c3ef3edb0/Cover?v=1680531653330 https://cdn.glitch.global/038fa3ae-8a76-4f32-bfa2-022c3ef3edb0/MapPackage?v=1680531659255 *I am editing this bundle There you will see that each bundle has its own container

2079541547 commented 10 months ago

You can give the added files container paths by modifying a file of type ResourceManager

2079541547 commented 10 months ago

屏幕截图 2023-10-29 103603 This is the example, cxwxst and cxwwk are the game fonts I added, referenced via global-metadata.dat