Ejemplo n.º 1
0
 static void ValidateCompatibility(RagdollProfile profile, RagdollDefinition definition)
 {
     if (!profile.IsCompatibleWith(definition))
     {
         throw new IncompatibleRagdollProfileException(profile, definition);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 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";
            }
        }