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