Skip to content

Commit ea18ad7

Browse files
feat: custom spine skin instructions
1 parent 59ef1ea commit ea18ad7

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

src/content/docs/reference/skins.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,51 @@ title: Skins
33
description: Documentation on how to add a custom skin using the Cult of the Lamb API
44
---
55

6-
## Creating Skins
6+
# Skins
7+
8+
This section is for loading custom spine using code, if you prefer using easier format (ie, JSON), check out [JSONSkin Loader](https://thunderstore.io/c/cult-of-the-lamb/p/KellyBetty/COTL_JSONLoader/) or [CustomSpineLoader](https://www.nexusmods.com/cultofthelamb/mods/49)
9+
10+
There are currently two methods of customizing skins:
11+
- Custom Spine Override
12+
- Skin texture Override
13+
14+
# Creating Custom Spine Overrides
15+
16+
Follow this if you have a Spine Skeleton and Atlas file. If not, you will need to use Skin Overrides instead.
17+
18+
### Exporting a usable Spine Skin
19+
- Ensure that you have exported the Spine Skin via 3.8.99 Spine
20+
- Export as a JSON file.
21+
- Output: Nonessential data: TRUE, Animation cleanup: TRUE, Warnings: TRUE
22+
- Texture atlas: Pack TRUE with default Pack Settings
23+
- If any warnings occur, it may be best to fix them, or the skin may not load into game.
24+
25+
### Loading the Spine Skin into Game
26+
27+
Simply follow the below to load the Spine into game:
28+
29+
```TextAsset atlasTextAsset, skeleTextAsset``` should be your .atlas file and .json file generated by Spine.
30+
31+
```Texture2D[] textures``` is an array of Texture2D that was packed with your Texture atlas.
32+
33+
```Material material``` is any Material with any Shader that you want to apply to the Spine Skeleton.
34+
35+
```string playerSpineName``` can be any string.
36+
37+
```string skinName``` must be your Skin's Name, from Spine.
38+
39+
40+
```csharp
41+
var runtimeAtlasAsset = Spine.Unity.SpineAtlasAsset.CreateRuntimeInstance(atlasTextAsset, textures, material, true);
42+
var runtimeSkeletonAsset = Spine.Unity.SkeletonDataAsset.CreateRuntimeInstance(skeleTextAsset, runtimeAtlasAsset, true);
43+
CustomSkinManager.AddPlayerSpine(playerSpineName, runtimeSkeletonAsset, skinList.ToList());
44+
CustomSkinManager.ChangeSelectedPlayerSpine(playerSpineName + "/" + skinName);
45+
```
46+
47+
48+
# Creating Skin Texture Overrides
49+
50+
Follow this if you are NOT making a Spine Override. This is for Skin Overrides.
751

852
**This applies to both follower skins and player skins.**
953

0 commit comments

Comments
 (0)