Class LegionEditor
- Namespace
- PixelUnitStudio
- Assembly
- PixelUnitStudio.Runtime.dll
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.
public sealed class LegionEditor : MonoBehaviour
- Inheritance
-
LegionEditor
Constructors
LegionEditor()
public LegionEditor()
Fields
catalog
public LegionCatalog catalog
Field Value
unitFolder
public string unitFolder
Field Value
Properties
ActionLibrary
Action library of the save folder. Created on the first saved action.
public LegionActionLibrary ActionLibrary { get; }
Property Value
ActionsOpen
public bool ActionsOpen { get; }
Property Value
Builder
public LegionBuilder Builder { get; }
Property Value
Dirty
public bool Dirty { get; }
Property Value
Draft
Action being built in the Actions panel.
public LegionAction Draft { get; }
Property Value
LibraryOpen
public bool LibraryOpen { get; }
Property Value
LoadedCode
public string LoadedCode { get; }
Property Value
SelectedSlot
public string SelectedSlot { get; }
Property Value
Methods
AddStep(string)
Adds a motion as the draft's last step. The same motion twice in a row counts up the repeat instead.
public void AddStep(string motion)
Parameters
motionstring
Choose(string, int)
Applies a slot option (-1 clears it). Records an undo step.
public void Choose(string slotName, int index)
Parameters
ClearDraft()
Starts a new, empty action.
public void ClearDraft()
CopyRecipe()
Copies the current combination to the clipboard as text (LegionRecipe) and returns that text. Read it in game code with LegionRecipe.Parse.
public string CopyRecipe()
Returns
CycleBackdrop()
public void CycleBackdrop()
Delete(string)
Deletes a saved hero. If it is the currently open hero, it remains as an unsaved new hero.
public void Delete(string code)
Parameters
codestring
DeleteAction(string)
public void DeleteAction(string actionName)
Parameters
actionNamestring
Dye(string, string)
Dyes a slot (null restores the original color). Records an undo step.
public void Dye(string slotName, string paletteName)
Parameters
EditAction(LegionAction)
Loads any action (such as one from a content pack) into the draft. Saving puts it in the save folder's library.
public void EditAction(LegionAction action)
Parameters
actionLegionAction
EditAction(string)
Loads a saved action into the draft to change it. Saving it under the same name replaces it.
public void EditAction(string actionName)
Parameters
actionNamestring
Export()
Saves the current hero, then exports a frame sheet using the motions of its back-hand weapon type and returns the PNG path.
public string Export()
Returns
Flip()
public void Flip()
Load(LegionUnit)
public void Load(LegionUnit unit)
Parameters
unitLegionUnit
MotionTitle(string)
public static string MotionTitle(string motion)
Parameters
motionstring
Returns
NewHero()
public void NewHero()
OpenActions()
public void OpenActions()
OpenLibrary()
public void OpenLibrary()
OptionTitle(string)
Card name of an option. Options with no name given show the file name tidied (axe_frost → Axe frost).
public static string OptionTitle(string option)
Parameters
optionstring
Returns
PackActions()
Actions of the content packs' hero folders, as (pack title, actions). Played and copied from the edit screen; they are not changed here.
public List<(string title, List<LegionAction> actions)> PackActions()
Returns
PasteRecipe(string)
Applies a combination written as text (can be undone). False if unreadable. Names not in the catalog are shown in the notice and skipped.
public bool PasteRecipe(string text)
Parameters
textstring
Returns
Play(Motion)
public void Play(LegionCatalog.Motion motion)
Parameters
motionLegionCatalog.Motion
PlayAction(LegionAction)
Plays an action on the preview hero with its weapon type (the draft if none is given).
public void PlayAction(LegionAction action = null)
Parameters
actionLegionAction
Randomize()
Shuffles all slots at once. Slots that can be cleared are sometimes cleared.
public void Randomize()
RemoveStep(int)
public void RemoveStep(int index)
Parameters
indexint
Save()
public string Save()
Returns
SaveAction()
Saves the draft into the folder's action library and returns the saved name. An empty name gets "Action N"; the same name replaces.
public string SaveAction()
Returns
Seek(float)
Moves to a point (0 to 1) of the motion and pauses.
public void Seek(float t)
Parameters
tfloat
SelectSlot(string)
public void SelectSlot(string slotName)
Parameters
slotNamestring
SetPaused(bool)
public void SetPaused(bool value)
Parameters
valuebool
SetRepeat(int, int)
public void SetRepeat(int index, int repeat)
Parameters
SetSkin(string)
Changes the skin color (null for the default skin). Records an undo step.
public void SetSkin(string skinName)
Parameters
skinNamestring
SetZoom(int)
public void SetZoom(int value)
Parameters
valueint
SlotTitle(string)
public static string SlotTitle(string slot)
Parameters
slotstring
Returns
Undo()
public void Undo()
WeaponKind(string)
public static string WeaponKind(string option)
Parameters
optionstring