//all the gui stuff
void OnGUI()
{
GUI.Label(new Rect(10, 10, 200, 20), "Create New AI Characters", EditorStyles.boldLabel);

EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();

EditorGUILayout.BeginHorizontal();
{
EditorGUILayout.LabelField("Name of new AI");
newName = EditorGUILayout.TextField(newName);
}
EditorGUILayout.EndHorizontal();

EditorGUILayout.BeginHorizontal();
{
EditorGUILayout.LabelField("Please select with navigation system the AI should use");
navsysToUse = (NavSystems)EditorGUILayout.EnumPopup( "", navsysToUse);
}
EditorGUILayout.EndHorizontal();

EditorGUILayout.BeginHorizontal();
{
EditorGUILayout.LabelField("Please select the object that contains the model with the ragdoll");
modelObject = EditorGUILayout.ObjectField(modelObject, typeof(Transform), true) as Transform;
}
EditorGUILayout.EndHorizontal();

EditorGUILayout.BeginHorizontal();
{
EditorGUILayout.LabelField("Please select FINISHED WEAPON object (optional at this stage)");
weaponObjet = EditorGUILayout.ObjectField(weaponObjet, typeof(Object), true) as GameObject;
}
EditorGUILayout.EndHorizontal();


EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();

if(GUILayout.Button("Create AI") && modelObject != null)
{
CreateNewAI();
}

}
//all the gui stuff
    void OnGUI()
    {
        GUI.Label(new Rect(10, 10, 200, 20), "Create New AI Characters", EditorStyles.boldLabel);

        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.LabelField("Name of new AI");
            newName = EditorGUILayout.TextField(newName);
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.LabelField("Please select with navigation system the AI should use");
            navsysToUse = (NavSystems)EditorGUILayout.EnumPopup("", navsysToUse);
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.LabelField("Please select the object that contains the model with the ragdoll");
            modelObject = EditorGUILayout.ObjectField(modelObject, typeof(Transform), true) as Transform;
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        {
            EditorGUILayout.LabelField("Please select FINISHED WEAPON object (optional at this stage)");
            weaponObjet = EditorGUILayout.ObjectField(weaponObjet, typeof(Object), true) as GameObject;
        }
        EditorGUILayout.EndHorizontal();


        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        if (GUILayout.Button("Create AI") && modelObject != null)
        {
            CreateNewAI();
        }
    }