A class in Root.Township, the global namespace.
Maps each BoneIdentifier in a required bone list to the matching transform in a character rig. Used, for example, to attach orbs to the player's body.
Constructors
| Member | What it is |
|---|
RigMap() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private List<Transform> bones | Transforms in the same order as the required list. |
private bool btnFind | Inspector button that calls Find. |
private Dictionary<BoneIdentifier, Transform> map | Cached bone map. |
private RigBoneList requiredList | List of bones the rig must have. |
Properties
| Member | What it is |
|---|
Dictionary<BoneIdentifier, Transform> Bones { get; } | Bone identifier to transform map, built on first use. |
Methods
| Member | What it is |
|---|
void Find() | Editor: refills bones by finding each required bone by name under this transform. |
Transform[] Map(BoneIdentifier[] boneIdentifiers) | Returns the transforms for an array of bone identifiers, in the same order. |
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Builds the bone map. |
private Dictionary<BoneIdentifier, Transform> GetBones() | Builds the map from requiredList and bones the first time and returns it. Later changes to bones are not picked up. |
private void OnValidate() | Editor: re-runs Find when the bone count doesn't match the required list. |
Used in
Members of other types that take, return or hold a RigMap: