Class LegionAnimation

Namespace
PixelUnitStudio.Editor
Assembly
PixelUnitStudio.Editor.dll

Builds AnimationClips and an Animator from legion_anims.json, and exports the motions as 64×64 1:1 pixel frame sheets.

public static class LegionAnimation
Inheritance
LegionAnimation
Inherited Members

Fields

ControllerPath

public const string ControllerPath = "Assets/PixelUnitStudio/Generated/Animations/Legion.controller"

Field Value

string

Methods

BuildClips()

public static void BuildClips()

ExportHero(LegionUnit, string)

Exports a saved hero using the motions of its back-hand weapon type. Looks up the motion set of the weapon option in the catalog.

public static string ExportHero(LegionUnit unit, string outputPng)

Parameters

unit LegionUnit
outputPng string

Returns

string

ExportSavedHeroes()

Exports every hero in the save folder to Exports/Heroes/<code>.png(.json). Returns the exported paths.

public static List<string> ExportSavedHeroes()

Returns

List<string>

ExportSheet(GameObject, string, Dictionary<string, int>, string)

Renders every motion of the rig prefab frame by frame and saves them as a sheet, one motion per row. Given a motionSet (spear, heavy, bow, etc.) it exports that weapon type's motions; left empty it exports the default (sword, axe, blunt) motions. Frames are 64×64 by default (origin: horizontal center, ground 2px from the bottom); if big or long weapons have pixels outside that, all frames are widened to fit (in steps of 8px horizontally and vertically). The origin is at the same spot in every frame, and size and origin are written to the .json.

public static string ExportSheet(GameObject prefab, string outputPng, Dictionary<string, int> sortOverrides = null, string motionSet = null)

Parameters

prefab GameObject
outputPng string
sortOverrides Dictionary<string, int>
motionSet string

Returns

string