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.
- Listed in Global namespace: M to O
- Inherits or implements
MonoBehaviour - Nested types
Definition,FreeDefinition,IDefinition,ItemArguments,OverrideSet - Attributes
ExecuteInEditMode
Constructors
| Member | What it is |
|---|---|
ModellingCharacter() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
12 private and internal fields
| Member | What it is |
|---|---|
private ModellingCharacter.Definition[] advertising | Cosmetics added last, for advertising shots. |
private ModellingCharacter.FreeDefinition[] basics | Base cosmetics added first. |
private bool btnRandomize | Inspector button flag for Randomize. |
private bool btnReset | Inspector button flag for Reset. |
private ModellingCharacter.FreeDefinition[] free | Free cosmetics added to the dummy. |
private PlayerCustomizationHandler handler | Customization handler on the dummy being dressed. |
private bool isUpdatingDynamically | If true, the model rebuilds whenever an inspector value changes. |
private static readonly Logger logger | Logger for errors while rebuilding the model. |
private PlayerCharacterCustomizationManager manager | Customization manager created for the dummy. |
private ModellingCharacter.Definition[] randomized | Cosmetics added after the basics; meant to be filled by Randomize. |
private AddressableSession session | Addressables session the cosmetics load through. |
private ModellingCharacter.OverrideSet set | Optional cosmetic set whose items are all added, with per item colour overrides. |
Methods
| Member | What it is |
|---|---|
void FixEditorAddressables() | Context menu action that points the editor's Addressables runtime path at a fixed GUID. |
8 private and internal methods
| Member | What 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. |