public static void AssignRagdollComponents() { RagdollFactoryGenerated factory = new RagdollFactoryGenerated (); if ((Selection.gameObjects == null) || (Selection.gameObjects.Length != 1)) { EditorUtility.DisplayDialog ("No selection", "Please select the model object i.e. the parent object containing " + factory.rootBoneName, "OK"); return; } GameObject gameObject = Selection.activeGameObject; if (gameObject.transform.FindChild (factory.rootBoneName) == null) { EditorUtility.DisplayDialog ("Wrong selection", "The selected bone is not the appropriate for applying. Please select the model object i.e. the parent object containing " + factory.rootBoneName, "OK"); return; } factory.CreateRagdollComponents (gameObject); Debug.Log ("ragdoll components for " + gameObject.name + " created successfully"); }
public static void AssignRagdollComponents() { RagdollFactoryGenerated factory = new RagdollFactoryGenerated(); if ((Selection.gameObjects == null) || (Selection.gameObjects.Length != 1)) { EditorUtility.DisplayDialog("No selection", "Please select the model object i.e. the parent object containing " + factory.rootBoneName, "OK"); return; } GameObject gameObject = Selection.activeGameObject; if (gameObject.transform.FindChild(factory.rootBoneName) == null) { EditorUtility.DisplayDialog("Wrong selection", "The selected bone is not the appropriate for applying. Please select the model object i.e. the parent object containing " + factory.rootBoneName, "OK"); return; } factory.CreateRagdollComponents(gameObject); Debug.Log("ragdoll components for " + gameObject.name + " created successfully"); }