CosmeticMeshPartBase<T>
A class in Root.Township, Alta.Customization.
A cosmetic part that adds a mesh with its own texture to the character, coloured with two cosmetic colours. Attaching it adds an input to the character's cosmetic packer and repacks.
- Listed in Customization and screenshots
- Inherits or implements
CustomizationVisualPart<T>,ICosmeticMeshPartBase,ICustomizationPart - Derived types
CosmeticEyePart,CosmeticMeshPart,SkinMeshPart - Nested types
TextureCache
Constructors
| Member | What it is |
|---|---|
CosmeticMeshPartBase() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
17 private and internal fields
| Member | What it is |
|---|---|
private Mesh[] androidImpededLods | Android LOD meshes used when the part is impeded (covered by another item). Serialized but the packer reads impededLods. |
private Mesh[] androidLods | Android LOD meshes. Serialized but the packer reads lods. |
private Texture2D androidNormal | Android normal map. Serialized but not used by the getters. |
private Texture2D androidTexture | Android diffuse texture. Serialized but not used by the getters. |
private CustomizationVisualPart copyColorFrom | Another part whose colours this part shares; colour changes are passed on to it and the packer copies from its input. |
private Mesh[] impededLods | LOD meshes used when the part's arguments are marked impeded (for example hair under a hat). |
private bool isAlphaBlending | Whether the part is packed into the transparent meshes and drawn alpha blended. |
private bool isAlphaBlendingAndroid | Android version of isAlphaBlending. Serialized but not read. |
private bool isColorLocked | When set, ApplyColorToArguments refuses to recolour this part. |
private bool isDisabledOnAndroid | Serialized flag to skip the part on Android, but IsDisabledOnAndroid always returns false in this build. |
private bool isGeneratingBackFaces | When set, the mesh packer adds reversed triangles so the part shows from both sides. |
private bool isShownInFirstPerson | When false the part is packed into the head meshes, which are hidden in first person. |
private Mesh[] lods | LOD meshes for this part, highest detail first. |
private static Logger logger | NLog logger for this class. |
private Texture2D normal | Normal map packed into the character's normal atlas. |
private EditorLink originalLink | Editor link back to the source asset. |
private Texture2D texture | Diffuse texture packed into the character's atlas. |
Properties
| Member | What it is |
|---|---|
ICosmeticMeshPartBase CopyColorFrom { get; } | Another part whose colours this part shares, if any. |
Mesh[] ImpededLods { get; } | LOD meshes used instead when the part's arguments are marked impeded. If empty, the part is skipped then. |
bool IsAlphaBlending { get; } | Whether the part uses alpha blending. |
bool IsDisabledOnAndroid { get; } | Always false in this build, whatever the inspector says. |
bool IsGeneratingBackFaces { get; } | Whether back faces are generated for the mesh. |
virtual bool IsTextureSharingForced { get; } | Whether the packer must share this part's texture. False in the base class. |
Mesh[] Lods { get; } | The part's LOD meshes. |
Texture2D Normal { get; } | The part's normal map. |
Texture2D Texture { get; } | The part's diffuse texture. |
int WorkingIndex { get; set; } | Index the packer uses while working on this part. |
Methods
| Member | What it is |
|---|---|
bool ApplyColorToArguments(CosmeticColor color, bool isPrimary, CustomizationArguments[] arguments) | Sets the primary or secondary colour on this part and the part it copies from. False if locked or unchanged. |
virtual void GetCustomPickupColors(out CosmeticColor primary, out CosmeticColor secondary) | Colours to use when the part is shown as a pickup. Null in the base class. |
protected override void Attach(ICustomizationHandler handler, CustomizationArguments arguments) | Adds this part to the character's cosmetic packer and repacks. Logs an error if it is already there. |
protected override void ChangeArguments(ICustomizationHandler handler, CustomizationArguments arguments) | Updates the part's colours in the packer and repacks. |
protected virtual CosmeticPacker.Input CreateInput(ICustomizationHandler handler, CustomizationArguments arguments) | Builds the packer input: part id, colours, first-person visibility, blending and blit materials. |
protected override void Detach(ICustomizationHandler handler) | Removes this part from the packer, cleans its materials and repacks. |