using System.Collections.Generic; using UnityEngine; namespace ECE { [System.Serializable] /// /// Class to hold data for a skinned meshes' bones /// Used because the bones transform array can be empty in cases where optimize gameobjects is used on import /// The bindbose index of a bone, is the same as a bone's boneindex, so boneweight's can still be used. /// public class EasyColliderAutoSkinnedBone { public SkinnedMeshRenderer renderer; /// /// Create a collider for this bone? /// public bool Enabled = true; /// /// What kind of collider to create. /// public SKINNED_MESH_COLLIDER_TYPE ColliderType = SKINNED_MESH_COLLIDER_TYPE.Box; /// /// Minimum skinning bone weight to include a vertex in the bone's collider calculations. /// public float BoneWeight = 0.5f; /// /// Bone's display name (transform.name) /// public string BoneName = "Default"; /// /// Is this bone paired with another bone? /// public bool IsPaired = false; /// /// If this bone is paired, is this the bone that is displayed in the UI? /// public bool IsPairDisplayBone = false; /// /// Is this bone valid? (Has at least 1 vertex that meets it's boneWeight) /// public bool IsValid = false; public EasyColliderAutoSkinnedBone(Matrix4x4 bp, int index, Transform t) { BoneIndex = index; BindPose = bp; Transform = t; } /// /// Local to world matrix of the bone's transform. /// public Matrix4x4 Matrix; /// /// Bind pose of the bone /// public Matrix4x4 BindPose; /// /// Bind pose index is the bone index as well. /// public int BoneIndex; /// /// Transform of the bone /// public Transform Transform; /// /// List of vertices in world space for this bo /// /// /// public List WorldSpaceVertices = new List(); [SerializeField] /// /// List of other bone's index's in the BoneList that this bone is paired with. /// /// /// public List PairedBones = new List(); /// /// Collider for this bone. /// public Collider Collider; /// /// Indent level of this bone when displaying in UI. /// public int IndentLevel = -1; } }