😣Overview
Introduction
You can load resources in different ways.
Get resources in game
You can get Resources
structure in Resources
Sprite
Single sprite
It is common to get a single sprite through SpriteTextureLoader.getSprite(string path)
manually.
Parameter path
is the path to the sprite resource in Resources
(a unity class).
Such as
Sprite list
It is common to get a list of sprites through SpriteTextureLoader.getSpriteList(string path)
manually.
It is Resources.LoadAll
with cache. Parameter path
is the path to the sprites resources in Resources
.
Such as
Others
For other resources, you can load them through Resources.Load
or Resources.LoadAll
.
Add resources to game
Add resources automatically
It only supports to add sprites and text automatically.
Make a folder named "GameResources" in your mod folder and see it as "Resources" folder in unity. Place your pictures or texts in it. It's case-insensitive about folder and file name.
For sprite, you can configure your sprite through sprites.json
or *.meta
(if you dont know what's meta file in unity, just use sprites.json).
sprites.json
A sprites.json file will be deserialized into an instance of SpritesSettings
.
Definition of SpritesSettings
:
Default setting will be applied to files which have not Specific setting.
*.meta
It is a meta file generated by unity, it is used to load atlas or sprite sheet.
Patch resources manually
Get resources in real file system
Last updated