Class LegionImporter

Namespace
PixelUnitStudio.Editor
Assembly
PixelUnitStudio.Editor.dll

Slices the body sheet per rig.json, and builds the mannequin prefab and a preview scene.

public static class LegionImporter
Inheritance
LegionImporter
Inherited Members

Methods

BuildRigPrefab(string, string, string, string, string, Dictionary<string, string>)

Slices a part sheet that follows the cell layout and saves it as a skeleton prefab. The weapon sheet (48×48, handle at the center) is optional. slotSheets maps slot name (Cloth, Hair, etc.) → a slot sheet with the same cell layout as the body sheet. Each is attached as a child named after the slot under each bone, with sorting value = bone sortBase + slot layer. Empty cells in a slot sheet are skipped.

public static GameObject BuildRigPrefab(string sheetPath, string prefabPath, string rootName, string weaponLeftPath = null, string weaponRightPath = null, Dictionary<string, string> slotSheets = null)

Parameters

sheetPath string
prefabPath string
rootName string
weaponLeftPath string
weaponRightPath string
slotSheets Dictionary<string, string>

Returns

GameObject

ImportWeaponSheet(string, string)

Imports a weapon sheet (square, handle at the center) and returns the sprite and sorting value to attach to the weapon bone.

public static (Sprite sprite, int sortingOrder) ImportWeaponSheet(string weaponBone, string path)

Parameters

weaponBone string
path string

Returns

(Sprite sprite, int sortingOrder)

ImportWeaponTurns(string, int, int)

Cuts pre-rotated weapon art (tools/generate_weapon_turns.py) cell by cell and returns it in angle order (counter-clockwise k×15°). Null if absent. The cell size is sheet width ÷ 6, and the center of each cell is the handle.

public static Sprite[] ImportWeaponTurns(string path, int turnCount = 24, int columns = 6)

Parameters

path string
turnCount int
columns int

Returns

Sprite[]

Run()

public static void Run()

SliceSlotSheet(string, string)

Slices a slot sheet and returns bone name → (sprite, sorting value). Used by the maker catalog.

public static Dictionary<string, (Sprite sprite, int sortingOrder)> SliceSlotSheet(string slotName, string path)

Parameters

slotName string
path string

Returns

Dictionary<string, (Sprite sprite, int sortingOrder)>