Esempio n. 1
0
        // Tries to guess the limb bones based on naming
        private static void DetectLimb(BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide, ref Transform firstBone, ref Transform secondBone, ref Transform lastBone, Transform[] transforms)
        {
            Transform[] limb = BipedNaming.GetBonesOfTypeAndSide(boneType, boneSide, transforms);

            if (limb.Length < 3)
            {
                //Warning.Log("Unable to detect biped bones by bone names. Please manually assign bone references.", firstBone, true);
                return;
            }

            // Standard biped characters
            if (limb.Length == 3)
            {
                firstBone  = limb[0];
                secondBone = limb[1];
                lastBone   = limb[2];
            }

            // For Bootcamp soldier type of characters with more than 3 limb bones
            if (limb.Length > 3)
            {
                firstBone  = limb[0];
                secondBone = limb[2];
                lastBone   = limb[limb.Length - 1];
            }
        }
Esempio n. 2
0
 public static Transform[] GetBonesOfSide(BipedNaming.BoneSide boneSide, Transform[] bones)
 {
     Transform[] array = new Transform[0];
     foreach (Transform transform in bones)
     {
         if (transform != null && BipedNaming.GetBoneSide(transform.name) == boneSide)
         {
             Array.Resize <Transform>(ref array, array.Length + 1);
             array[array.Length - 1] = transform;
         }
     }
     return(array);
 }
Esempio n. 3
0
 private static void DetectLimb(BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide, ref Transform firstBone, ref Transform secondBone, ref Transform lastBone, Transform[] transforms)
 {
     Transform[] bonesOfTypeAndSide = BipedNaming.GetBonesOfTypeAndSide(boneType, boneSide, transforms);
     if (bonesOfTypeAndSide.Length < 3)
     {
         return;
     }
     if (bonesOfTypeAndSide.Length == 3)
     {
         firstBone  = bonesOfTypeAndSide[0];
         secondBone = bonesOfTypeAndSide[1];
         lastBone   = bonesOfTypeAndSide[2];
     }
     if (bonesOfTypeAndSide.Length > 3)
     {
         firstBone  = bonesOfTypeAndSide[0];
         secondBone = bonesOfTypeAndSide[2];
         lastBone   = bonesOfTypeAndSide[bonesOfTypeAndSide.Length - 1];
     }
 }
Esempio n. 4
0
 public static Transform GetFirstBoneOfTypeAndSide(BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide, Transform[] bones)
 {
     Transform[] bonesOfTypeAndSide = BipedNaming.GetBonesOfTypeAndSide(boneType, boneSide, bones);
     if (bonesOfTypeAndSide.Length == 0)
     {
         return(null);
     }
     return(bonesOfTypeAndSide[0]);
 }
Esempio n. 5
0
 public static Transform[] GetBonesOfTypeAndSide(BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide, Transform[] bones)
 {
     Transform[] bonesOfType = BipedNaming.GetBonesOfType(boneType, bones);
     return(BipedNaming.GetBonesOfSide(boneSide, bonesOfType));
 }
Esempio n. 6
0
 public static Transform GetBone(Transform[] transforms, BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide = BipedNaming.BoneSide.Center, params string[][] namings)
 {
     return(BipedNaming.GetNamingMatch(BipedNaming.GetBonesOfTypeAndSide(boneType, boneSide, transforms), namings));
 }
        private static bool AddBoneToSpine(Transform bone, ref BipedReferences references, AutoDetectParams autoDetectParams) => default; // 0x00000001804B7BB0-0x00000001804B7D40

        private static void DetectLimb(BipedNaming.BoneType boneType, BipedNaming.BoneSide boneSide, ref Transform firstBone, ref Transform secondBone, ref Transform lastBone, Transform[] transforms)
        {
        }                                                                                                                                                                                                          // 0x00000001804B8AD0-0x00000001804B8C60