123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- 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;
- }
|