> For the complete documentation index, see [llms.txt](https://worldboxopenmods.gitbook.io/mod-tutorial-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://worldboxopenmods.gitbook.io/mod-tutorial-en/resources/overview.md).

# Overview

## Introduction

You can load resources in different ways.

## Get resources in game

You can get `Resources` structure in [Resources](/mod-tutorial-en/resources/assetbundle.md)

### 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

```csharp
SpriteTextureLoader.getSprite("ui/icons/iconOption")
```

#### 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

```csharp
SpriteTextureLoader.getSpriteList("effects/projectiles/arrow")
```

### Others

For other resources, you can load them through [`Resources.Load`](https://docs.unity.cn/cn/2019.4/ScriptReference/Resources.Load.html) or [`Resources.LoadAll`](https://docs.unity.cn/cn/2019.4/ScriptReference/Resources.LoadAll.html).

## 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`:

```csharp
class SpritesSettings
{
    public Setting Default;
    public List<Setting> Specific;
}
class Setting
{ 
    public float BorderB = 0.0f; // border bottom
    public float BorderL = 0.0f; // border left
    public float BorderR = 0.0f; // border right
    public float BorderT = 0.0f; // border top
    public string Path = "\\";   // corresponded file path
    public float PivotX = 0.5f;  // pivot x, default to be center
    public float PivotY = 0.0f;  // pivot y, default to be center
    public float PixelsPerUnit = 1f; // if you dont know what it is, keep it 1
    public float RectX = 0.0f;   // keep it 0 now
    public float RectY = 0.0f;   // keep it 0 now
}
```

Default setting will be applied to files which have not Specific setting.

[Example of sprite.json](https://github.com/inmny/Cultivation-Way-Core/blob/main/GameResources/actors/races/eastern_human/unit_king/sprites.json)

#### \*.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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://worldboxopenmods.gitbook.io/mod-tutorial-en/resources/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
