using System; using UnityEngine; public class SAColliderBuilderCommon { public enum ShapeType { None, Mesh, Box, Capsule, Sphere } public enum FitType { Outer, Inner } public enum MeshType { Raw, ConvexBoxes, ConvexHull, Box } public enum SliceMode { Auto, X, Y, Z } public enum ElementType { X, XYZ } [Serializable] public struct Bool3 { public Bool3(bool x, bool y, bool z) { this.x = x; this.y = y; this.z = z; } public void SetValue(bool x, bool y, bool z) { this.x = x; this.y = y; this.z = z; } public bool x; public bool y; public bool z; } public enum ColliderToChild { Auto, On, Off } [Serializable] public class ReducerProperty { public SAColliderBuilderCommon.ReducerProperty ShallowCopy() { return (SAColliderBuilderCommon.ReducerProperty)base.MemberwiseClone(); } public SAColliderBuilderCommon.ShapeType shapeType = SAColliderBuilderCommon.ShapeType.Box; public SAColliderBuilderCommon.FitType fitType; public SAColliderBuilderCommon.MeshType meshType = SAColliderBuilderCommon.MeshType.Box; public int maxTriangles = 255; public SAColliderBuilderCommon.SliceMode sliceMode; public Vector3 scale = Vector3.one; public SAColliderBuilderCommon.ElementType scaleElementType; public Vector3 minThickness = new Vector3(0.01f, 0.01f, 0.01f); public SAColliderBuilderCommon.ElementType minThicknessElementType; public SAColliderBuilderCommon.Bool3 optimizeRotation = new SAColliderBuilderCommon.Bool3(true, true, true); public SAColliderBuilderCommon.ElementType optimizeRotationElementType; public SAColliderBuilderCommon.ColliderToChild colliderToChild; public Vector3 offset = Vector3.zero; public Vector3 thicknessA = Vector3.zero; public Vector3 thicknessB = Vector3.zero; public bool viewAdvanced; } [Serializable] public class ColliderProperty { public SAColliderBuilderCommon.ColliderProperty ShallowCopy() { return (SAColliderBuilderCommon.ColliderProperty)base.MemberwiseClone(); } public bool convex = true; public bool isTrigger; public PhysicMaterial material; public bool isCreateAsset; } [Serializable] public class RigidbodyProperty { public SAColliderBuilderCommon.RigidbodyProperty ShallowCopy() { return (SAColliderBuilderCommon.RigidbodyProperty)base.MemberwiseClone(); } public float mass = 1f; public float drag; public float angularDrag = 0.05f; public bool isKinematic = true; public bool useGravity; public RigidbodyInterpolation interpolation; public CollisionDetectionMode collisionDetectionMode; public bool isCreate = true; public bool viewAdvanced; } }