123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- using System;
- using UnityEngine;
- public class SAMeshColliderCommon
- {
- public enum SplitMode
- {
- None,
- Material,
- Primitive,
- Polygon
- }
- [Serializable]
- public class SplitMesh
- {
- public void PurgeTemporary()
- {
- this.triangles = null;
- this.vertices = null;
- this.triangleNormals = null;
- }
- public int subMeshCount;
- public int subMesh = -1;
- public int triangle = -1;
- public Vector3 triangleVertex;
- public int[] polygonTriangles;
- public Vector3[] polygonVertices;
- [NonSerialized]
- public int[] triangles;
- [NonSerialized]
- public Vector3[] vertices;
- [NonSerialized]
- public Vector3[] triangleNormals;
- }
- [Serializable]
- public class SplitProperty
- {
- public SAMeshColliderCommon.SplitProperty ShallowCopy()
- {
- return (SAMeshColliderCommon.SplitProperty)base.MemberwiseClone();
- }
- public bool splitMaterialEnabled = true;
- public bool splitPrimitiveEnabled = true;
- public bool splitPolygonNormalEnabled;
- public float splitPolygonNormalAngle = 45f;
- }
- [Serializable]
- public class SAMeshColliderProperty
- {
- public SAMeshColliderCommon.SAMeshColliderProperty Copy()
- {
- SAMeshColliderCommon.SAMeshColliderProperty sameshColliderProperty = new SAMeshColliderCommon.SAMeshColliderProperty();
- if (this.splitProperty != null)
- {
- sameshColliderProperty.splitProperty = this.splitProperty.ShallowCopy();
- }
- if (this.reducerProperty != null)
- {
- sameshColliderProperty.reducerProperty = this.reducerProperty.ShallowCopy();
- }
- if (this.colliderProperty != null)
- {
- sameshColliderProperty.colliderProperty = this.colliderProperty.ShallowCopy();
- }
- if (this.rigidbodyProperty != null)
- {
- sameshColliderProperty.rigidbodyProperty = this.rigidbodyProperty.ShallowCopy();
- }
- sameshColliderProperty.modifyNameEnabled = this.modifyNameEnabled;
- return sameshColliderProperty;
- }
- public SAMeshColliderCommon.SplitProperty splitProperty = new SAMeshColliderCommon.SplitProperty();
- public SAColliderBuilderCommon.ReducerProperty reducerProperty = new SAColliderBuilderCommon.ReducerProperty();
- public SAColliderBuilderCommon.ColliderProperty colliderProperty = new SAColliderBuilderCommon.ColliderProperty();
- public SAColliderBuilderCommon.RigidbodyProperty rigidbodyProperty = new SAColliderBuilderCommon.RigidbodyProperty();
- public bool modifyNameEnabled = true;
- }
- [Serializable]
- public class SAMeshColliderBuilderProperty
- {
- public SAMeshColliderCommon.SAMeshColliderBuilderProperty Copy()
- {
- SAMeshColliderCommon.SAMeshColliderBuilderProperty sameshColliderBuilderProperty = new SAMeshColliderCommon.SAMeshColliderBuilderProperty();
- if (this.splitProperty != null)
- {
- sameshColliderBuilderProperty.splitProperty = this.splitProperty.ShallowCopy();
- }
- if (this.reducerProperty != null)
- {
- sameshColliderBuilderProperty.reducerProperty = this.reducerProperty.ShallowCopy();
- }
- if (this.colliderProperty != null)
- {
- sameshColliderBuilderProperty.colliderProperty = this.colliderProperty.ShallowCopy();
- }
- if (this.rigidbodyProperty != null)
- {
- sameshColliderBuilderProperty.rigidbodyProperty = this.rigidbodyProperty.ShallowCopy();
- }
- sameshColliderBuilderProperty.modifyNameEnabled = this.modifyNameEnabled;
- return sameshColliderBuilderProperty;
- }
- public SAMeshColliderCommon.SAMeshColliderProperty ToSAMeshColliderProperty()
- {
- SAMeshColliderCommon.SAMeshColliderProperty sameshColliderProperty = new SAMeshColliderCommon.SAMeshColliderProperty();
- if (this.splitProperty != null)
- {
- sameshColliderProperty.splitProperty = this.splitProperty.ShallowCopy();
- }
- if (this.reducerProperty != null)
- {
- sameshColliderProperty.reducerProperty = this.reducerProperty.ShallowCopy();
- }
- if (this.colliderProperty != null)
- {
- sameshColliderProperty.colliderProperty = this.colliderProperty.ShallowCopy();
- }
- if (this.rigidbodyProperty != null)
- {
- sameshColliderProperty.rigidbodyProperty = this.rigidbodyProperty.ShallowCopy();
- }
- sameshColliderProperty.modifyNameEnabled = this.modifyNameEnabled;
- return sameshColliderProperty;
- }
- public SAMeshColliderCommon.SplitProperty splitProperty = new SAMeshColliderCommon.SplitProperty();
- public SAColliderBuilderCommon.ReducerProperty reducerProperty = new SAColliderBuilderCommon.ReducerProperty();
- public SAColliderBuilderCommon.ColliderProperty colliderProperty = new SAColliderBuilderCommon.ColliderProperty();
- public SAColliderBuilderCommon.RigidbodyProperty rigidbodyProperty = new SAColliderBuilderCommon.RigidbodyProperty();
- public bool modifyNameEnabled = true;
- }
- }
|