Skip to main content

ModellingCharacter

A class in Root.Township, the global namespace.

Editor tool that dresses a character dummy in chosen cosmetics, for modelling and promo shots. Runs in edit mode.

Constructors​

MemberWhat it is
ModellingCharacter()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

12 private and internal fields
MemberWhat it is
private ModellingCharacter.Definition[] advertisingCosmetics added last, for advertising shots.
private ModellingCharacter.FreeDefinition[] basicsBase cosmetics added first.
private bool btnRandomizeInspector button flag for Randomize.
private bool btnResetInspector button flag for Reset.
private ModellingCharacter.FreeDefinition[] freeFree cosmetics added to the dummy.
private PlayerCustomizationHandler handlerCustomization handler on the dummy being dressed.
private bool isUpdatingDynamicallyIf true, the model rebuilds whenever an inspector value changes.
private static readonly Logger loggerLogger for errors while rebuilding the model.
private PlayerCharacterCustomizationManager managerCustomization manager created for the dummy.
private ModellingCharacter.Definition[] randomizedCosmetics added after the basics; meant to be filled by Randomize.
private AddressableSession sessionAddressables session the cosmetics load through.
private ModellingCharacter.OverrideSet setOptional cosmetic set whose items are all added, with per item colour overrides.

Methods​

MemberWhat it is
void FixEditorAddressables()Context menu action that points the editor's Addressables runtime path at a fixed GUID.
8 private and internal methods
MemberWhat it is
private void Add(IEnumerable<ModellingCharacter.IDefinition> definitions)Adds each definition's cosmetic to the dummy, applying any primary and secondary colour overrides.
private void Fix(IEnumerable<ModellingCharacter.IDefinition> definitions)Resizes each definition's colour argument list to match what its cosmetic expects.
private void OnDrawGizmos()Copies cosmetic names onto the inspector entries and refreshes the override set arguments.
private void OnValidate()Resets and rebuilds the model when Reset is pressed, or rebuilds it if dynamic updating is on.
private void Randomize()Empty in this build.
private async void RefreshModel()Starts a customization session if needed, then clears and re-adds all configured cosmetics to the dummy.
private void ResetDummy()Detaches the customization manager and cleans the dummy's cosmetics.
private void Start()Resets the dummy and builds the model.