Namespace PixelUnitStudio

Classes

LegionAction

A custom action: existing motions chained in order under one name (a three-hit combo, a channel-and-release spell). Steps are motion names, not states, so one action plays on any hero with that hero's weapon-type version of each motion. Played by LegionActionPlayer.

LegionAction.Step
LegionActionLibrary

Custom actions shared by every hero. The edit screen keeps them in LegionActions.asset in the hero save folder, and saved hero prefabs reference it through their LegionActionPlayer.

LegionActionPlayer

Plays custom actions (LegionAction) on a hero: each step's motion in turn, then back to idle (an action ending in death stays down). Saved hero prefabs carry one that references the action library of their save folder; heroes assembled with LegionBuilder get one from Builder.Actions. While an action plays, LegionEvents.returnToIdle waits for the action to finish. Hit and cast events still fire for every step.

LegionBuilder

Assembles one hero from the catalog, applies slot options, and plays motions that fit the back-hand weapon type. Used by the edit screen and save/export, and also for assembling heroes at game runtime (Create, LegionRecipe).

LegionCatalog

List used by the edit screen to assemble and play heroes. Built by the editor menu Tools > Pixel Legion Maker > Build Catalog.

LegionCatalog.Motion
LegionCatalog.Option
LegionCatalog.Piece
LegionCatalog.Projectile
LegionCatalog.Slot
LegionContentPack

A content pack: a folder of parts, weapons, projectiles and heroes that the catalog takes in (LegionCatalogBuilder). The base product is one pack (LegionBasePack.asset); an add-on is another pack asset in its own folder, so it holds only art and heroes and needs the base product to work. Name add-on art with the type first, as the base product does (axe_frost, helmet_raider), because weapon motions and filters come from the first word. Folders are relative to the folder that holds this asset. When packs are added, removed or their art changes, the catalog rebuilds itself in the editor.

LegionContentPack.Title
LegionDye

Dyes one part renderer. Redraws the art's main color group (the catalog option's dyeRamp, from dark colors) in the dye's color steps. The hero's skin color (Skins) likewise redraws the 3 base body skin colors. Shaders/LegionDye.shader does the color change; this component supplies the color pairs to change through a MaterialPropertyBlock. It stays in saved prefabs, so they are repainted the same way.

LegionDye.Palette

One dye. shades runs 5 steps from dark to light.

LegionEditor

Edit screen. It does not use the existing maker screen; the whole screen is built in code. The left is the slot list (current part art and name), the center is the preview and motions, and the right is the option grid of the chosen slot. UI text is in English. An option is applied with one click, and the first cell "None" removes it. Randomize, undo, hero list and save are in the top bar. For dyeable parts, a row of dye swatches appears above the options (the first cell is the original color). The preview is rendered 1:1 in pixels by a separate camera and shown scaled up by an integer factor.

LegionEvents

Receives events from motion clips. Attached to a hero root with an Animator (saved prefabs, heroes assembled with LegionBuilder). hit: the moment an attack lands (the moment a bow, crossbow or gun fires, or a thrown weapon leaves the hand), cast: the moment a cast goes out, end: end of a one-shot motion. The argument is the animator state name (attack, attack@spear, etc.).

LegionPixelCamera

Orthographic camera helper that shows pixels crisply regardless of render pipeline (replaces URP's Pixel Perfect Camera). Adjusts orthographicSize so the screen scales only by integer multiples of the reference resolution. One art pixel is always an N×N block of screen pixels. With upscaleRenderTexture on, it draws into a render texture at art resolution and shows it scaled by an integer factor. Then rotated bones and weapons also snap to the pixel grid and the pixel size stays even. The result is the same in Built-in and URP. Sprites must use Point filtering.

LegionProjectile

Flies one projectile from its start point to the target point, calls Arrived when it lands, then removes it. Bows, crossbows, guns and staffs fly the catalog's projectile art (Projectiles/) straight; thrown weapons throw the weapon art itself in an arc. A thrown weapon doesn't rotate its art; it spins by swapping pre-rotated art (turns), so pixels don't break. Hit detection is up to the game. Usually called from the hit event of an attack motion (LegionEvents).

LegionRecipe

One hero's combination written as option names. Used to assemble heroes at game runtime (LegionBuilder.Create / Apply). As text, "slot=option[:dye]" entries are joined by spaces. Example: "Helmet=helmet_mitre Cloth=robe_priest:gold WeaponRight=staff_sun". Written by name, so it is found correctly even if the catalog is rebuilt and the order changes. Slots not listed are cleared (if they can be) or set to the default. The skin color is written like "Skin=orc" (LegionDye.Skins). If not written, it is the default skin.

LegionStore

Saves a hero as a prefab and reads the saved list. Saving works only in the Unity Editor.

LegionTurns

Instead of rotating weapon art, swaps in whichever pre-rotated clean art (turns, counter-clockwise k×step°) is closest to the weapon angle. Rotating pixel art at an arbitrary angle at runtime breaks outlines and drops or overlaps pixels (tools/generate_weapon_turns.py). Attached to a renderer that is a child of the weapon bone. The motion decides the bone rotation as is, and this renderer cancels that rotation and changes only the art's direction.

LegionUnit

Record attached to the root of a saved hero prefab. Keeps the option name and dye chosen per slot so it can be loaded again. Stored by name, so it is found correctly even if the catalog is rebuilt and the order changes.

LegionUnit.Choice
PixelUnitStudioInfo

Product info. Kept in line with the version in the store package file name and the documentation.