Class LegionStore
- Namespace
- PixelUnitStudio
- Assembly
- PixelUnitStudio.Runtime.dll
Saves a hero as a prefab and reads the saved list. Saving works only in the Unity Editor.
public static class LegionStore
- Inheritance
-
LegionStore
- Inherited Members
Fields
DefaultFolder
public const string DefaultFolder = "Assets/PixelUnitStudio/Units/"
Field Value
Exporter
Function that exports a saved hero as a frame sheet (hero, path → written PNG path). The sheet render is editor code, so Editor/LegionAnimation fills it in when the editor loads. If empty, nothing can be exported.
public static Func<LegionUnit, string> Exporter
Field Value
PackFolders
Hero folders of the content packs as (pack title, folder), for the edit screen's hero and action lists. Set by editor code (LegionPacks); empty in builds.
public static Func<List<(string title, string folder)>> PackFolders
Field Value
Methods
Actions(string, bool)
Loads the folder's action library, creating it if create is true. Null if there is none (or outside the Unity Editor).
public static LegionActionLibrary Actions(string folder, bool create)
Parameters
Returns
ActionsPath(string)
Custom action library of a save folder (folder/LegionActions.asset). Saved heroes in the folder reference it.
public static string ActionsPath(string folder)
Parameters
folderstring
Returns
Delete(string, string)
Deletes folder/code.prefab. True if deleted.
public static bool Delete(string folder, string code)
Parameters
Returns
Export(LegionUnit)
Exports a saved hero using the motions of its back-hand weapon type and returns the PNG path.
public static string Export(LegionUnit unit)
Parameters
unitLegionUnit
Returns
NewCode()
public static string NewCode()
Returns
OtherPackFolders(string)
Pack hero folders other than the given save folder.
public static List<(string title, string folder)> OtherPackFolders(string folder)
Parameters
folderstring
Returns
Save(LegionCatalog, IReadOnlyDictionary<string, int>, string, string, IReadOnlyDictionary<string, string>, string)
Saves the option combination as folder/code.prefab and returns the path. Overwrites if the code is the same. The preview may be in a mid-motion pose, so it is reassembled fresh from the rig original and saved in the default pose.
public static string Save(LegionCatalog catalog, IReadOnlyDictionary<string, int> choice, string folder, string code, IReadOnlyDictionary<string, string> dyes = null, string skin = null)
Parameters
catalogLegionCatalogchoiceIReadOnlyDictionary<string, int>folderstringcodestringdyesIReadOnlyDictionary<string, string>skinstring
Returns
SaveActions(LegionActionLibrary)
Writes changes to an action library to disk (Unity Editor only).
public static void SaveActions(LegionActionLibrary library)
Parameters
libraryLegionActionLibrary
Saved(string)
Hero prefabs in the save folder. Returned in code order (creation order).
public static List<LegionUnit> Saved(string folder)
Parameters
folderstring