Skip to main content

SAMeshCollider

A class in Root.Township, the global namespace.

Component from the third-party SA Collider Builder editor tool: holds the settings used to build mesh colliders for an object. Editor-time data; nothing in the game reads it at runtime.

Constructors​

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

Fields​

MemberWhat it is
bool cleanupModifiedRuntime-only editor flag. Not serialized.
SAMeshColliderCommon.SAMeshColliderProperty defaultMeshColliderPropertyThe default mesh collider settings to reset to.
string defaultNameBase GameObject name the tool adds its * or + marks to.
SAMeshColliderCommon.SAMeshColliderProperty edittingMeshCollidertPropertyCopy of the settings being edited in the inspector. Not serialized.
bool isDebugEditor debug flag. Not serialized.
SAMeshColliderCommon.SAMeshColliderProperty meshColliderPropertyThe mesh collider build settings: split, reducer, collider and rigidbody options.
bool modifiedTrue when this object's collider settings differ from the defaults.
bool modifiedChildrenTrue when a child's collider settings were changed.
SAMeshColliderCommon.SplitMesh splitMeshWhich mesh part this component stands for when split.
SAMeshColliderCommon.SplitMode splitModeHow this object's mesh is split.

Properties​

MemberWhat it is
SAColliderBuilderCommon.ColliderProperty colliderProperty { get; }Collider settings from meshColliderProperty, or null.
bool modifyNameEnalbed { get; }Whether the tool marks the GameObject name with * or + (misspelt in the code).
SAColliderBuilderCommon.ReducerProperty reducerProperty { get; }Mesh reduction settings from meshColliderProperty, or null.
SAColliderBuilderCommon.RigidbodyProperty rigidbodyProperty { get; }Rigidbody settings from meshColliderProperty, or null.
bool splitMaterialEnabled { get; }Whether the mesh is split into separate colliders per material.
float splitPolygonNormalAngle { get; }Angle threshold used when splitting by polygon normal. 0 if no split settings.
bool splitPolygonNormalEnabled { get; }Whether the mesh is split by polygon normal direction.
bool splitPrimitiveEnabled { get; }Whether the mesh is split by primitive.
SAMeshColliderCommon.SplitProperty splitProperty { get; }Split settings from meshColliderProperty, or null.

Methods​

MemberWhat it is
string _ComputeModifyName()The base name with * added if modified or + if only children are modified.
bool _IsModifyName()True if name marking is on and the GameObject's current name matches the computed name.
void ChangeDefaultName(string defaultName)Sets the base name and renames the GameObject if its name was the tool's computed name.
void ChangeModified(bool modified)Sets the modified flag and updates the GameObject's marked name if the tool manages it.
void ChangeModifiedChildren(bool modifiedChildren)Sets the children-modified flag and updates the GameObject's marked name if the tool manages it.
void ResetModified()Clears both modified flags and restores the unmarked name if the tool manages it.
void ResetModifyName()Renames the GameObject to the computed name when name marking is on.