using System; using UnityEngine; public class SAMeshCollider : MonoBehaviour { public SAMeshColliderCommon.SplitProperty splitProperty { get { return (this.meshColliderProperty == null) ? null : this.meshColliderProperty.splitProperty; } } public SAColliderBuilderCommon.ReducerProperty reducerProperty { get { return (this.meshColliderProperty == null) ? null : this.meshColliderProperty.reducerProperty; } } public SAColliderBuilderCommon.ColliderProperty colliderProperty { get { return (this.meshColliderProperty == null) ? null : this.meshColliderProperty.colliderProperty; } } public SAColliderBuilderCommon.RigidbodyProperty rigidbodyProperty { get { return (this.meshColliderProperty == null) ? null : this.meshColliderProperty.rigidbodyProperty; } } public bool splitMaterialEnabled { get { return this.splitProperty != null && this.splitProperty.splitMaterialEnabled; } } public bool splitPrimitiveEnabled { get { return this.splitProperty != null && this.splitProperty.splitPrimitiveEnabled; } } public bool splitPolygonNormalEnabled { get { return this.splitProperty != null && this.splitProperty.splitPolygonNormalEnabled; } } public float splitPolygonNormalAngle { get { return (this.splitProperty == null) ? 0f : this.splitProperty.splitPolygonNormalAngle; } } public bool modifyNameEnalbed { get { return this.meshColliderProperty != null && this.meshColliderProperty.modifyNameEnabled; } } public void ChangeDefaultName(string defaultName) { bool flag = this._IsModifyName(); this.defaultName = defaultName; if (this.modifyNameEnalbed && flag) { base.gameObject.name = this._ComputeModifyName(); } } public void ChangeModified(bool modified) { bool flag = this._IsModifyName(); this.modified = modified; if (this.modifyNameEnalbed && flag) { base.gameObject.name = this._ComputeModifyName(); } } public void ChangeModifiedChildren(bool modifiedChildren) { bool flag = this._IsModifyName(); this.modifiedChildren = modifiedChildren; if (this.modifyNameEnalbed && flag) { base.gameObject.name = this._ComputeModifyName(); } } public void ResetModified() { bool flag = this._IsModifyName(); this.modified = false; this.modifiedChildren = false; if (this.modifyNameEnalbed && flag) { base.gameObject.name = this._ComputeModifyName(); } } public void ResetModifyName() { if (this.modifyNameEnalbed) { base.gameObject.name = this._ComputeModifyName(); } } public string _ComputeModifyName() { if (this.modifyNameEnalbed) { if (this.modified) { if (string.IsNullOrEmpty(this.defaultName)) { return "*"; } return this.defaultName + "*"; } else if (this.modifiedChildren) { if (string.IsNullOrEmpty(this.defaultName)) { return "+"; } return this.defaultName + "+"; } } if (string.IsNullOrEmpty(this.defaultName)) { return string.Empty; } return this.defaultName; } public bool _IsModifyName() { if (!this.modifyNameEnalbed) { return false; } if (string.IsNullOrEmpty(base.gameObject.name)) { return string.IsNullOrEmpty(this._ComputeModifyName()); } return base.gameObject.name == this._ComputeModifyName(); } public SAMeshColliderCommon.SplitMesh splitMesh = new SAMeshColliderCommon.SplitMesh(); public SAMeshColliderCommon.SplitMode splitMode; public SAMeshColliderCommon.SAMeshColliderProperty meshColliderProperty = new SAMeshColliderCommon.SAMeshColliderProperty(); public string defaultName = string.Empty; public SAMeshColliderCommon.SAMeshColliderProperty defaultMeshColliderProperty = new SAMeshColliderCommon.SAMeshColliderProperty(); [NonSerialized] public SAMeshColliderCommon.SAMeshColliderProperty edittingMeshCollidertProperty; public bool modified; public bool modifiedChildren; [NonSerialized] public bool cleanupModified; [NonSerialized] public bool isDebug; }