static void ValidateCompatibility(RagdollProfile profile, RagdollDefinition definition)
 {
     if (!profile.IsCompatibleWith(definition))
     {
         throw new IncompatibleRagdollProfileException(profile, definition);
     }
 }
 public static void ValidateAsArgument(RagdollProfile profile, RagdollDefinition definition, bool isRequired, string nullMessage = "")
 {
     if (!profile)
     {
         if (isRequired && Application.isPlaying)
         {
             throw new System.ArgumentNullException(nullMessage);
         }
     }
     else
     {
         ValidateCompatibility(profile, definition);
     }
 }
 public static void ValidateAsInspectorField(RagdollProfile profile, RagdollDefinition definition, bool isRequired, string nullMessage = "")
 {
     if (!profile)
     {
         if (isRequired && Application.isPlaying)
         {
             throw new UnassignedReferenceException(nullMessage);
         }
     }
     else
     {
         ValidateCompatibility(profile, definition);
     }
 }
        public IncompatibleRagdollProfileException(RagdollProfile profile, RagdollDefinition definition)
        {
            if (profile)
            {
                this.profile = profile.name;
            }
            else
            {
                this.profile = "null";
            }

            if (definition)
            {
                this.definition = definition.name;
            }
            else
            {
                this.definition = "null";
            }
        }