using System; using UnityEngine; public class SABoneCollider : MonoBehaviour { public SABoneColliderCommon.BoneProperty boneProperty { get { return (this.boneColliderProperty == null) ? null : this.boneColliderProperty.boneProperty; } } public SABoneColliderCommon.SplitProperty splitProperty { get { return (this.boneColliderProperty == null) ? null : this.boneColliderProperty.splitProperty; } } public SAColliderBuilderCommon.ReducerProperty reducerProperty { get { return (this.boneColliderProperty == null) ? null : this.boneColliderProperty.reducerProperty; } } public SAColliderBuilderCommon.ColliderProperty colliderProperty { get { return (this.boneColliderProperty == null) ? null : this.boneColliderProperty.colliderProperty; } } public SAColliderBuilderCommon.RigidbodyProperty rigidbodyProperty { get { return (this.boneColliderProperty == null) ? null : this.boneColliderProperty.rigidbodyProperty; } } public bool recursivery { get { return this.boneProperty != null && this.boneProperty.recursivery; } } public bool modifyNameEnalbed { get { return this.boneColliderProperty != null && this.boneColliderProperty.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 SABoneColliderCommon.SABoneColliderProperty boneColliderProperty = new SABoneColliderCommon.SABoneColliderProperty(); public string defaultName = string.Empty; public SABoneColliderCommon.SABoneColliderProperty defaultBoneColliderProperty = new SABoneColliderCommon.SABoneColliderProperty(); [NonSerialized] public SABoneColliderCommon.SABoneColliderProperty edittingBoneColliderProperty; public bool modified; public bool modifiedChildren; [NonSerialized] public bool cleanupModified; [NonSerialized] public bool isDebug; }