{"action":"created","issue":{"url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/issues/37","repository_url":"https://api.github.com/repos/Baste-RainGames/Node_Editor","labels_url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/issues/37/comments","events_url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/issues/37/events","html_url":"https://github.com/Baste-RainGames/Node_Editor/issues/37","id":134658725,"number":37,"title":"Action Node","user":{"login":"Seneral","id":12800840,"avatar_url":"https://avatars.githubusercontent.com/u/12800840?v=3","gravatar_id":"","url":"https://api.github.com/users/Seneral","html_url":"https://github.com/Seneral","followers_url":"https://api.github.com/users/Seneral/followers","following_url":"https://api.github.com/users/Seneral/following{/other_user}","gists_url":"https://api.github.com/users/Seneral/gists{/gist_id}","starred_url":"https://api.github.com/users/Seneral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seneral/subscriptions","organizations_url":"https://api.github.com/users/Seneral/orgs","repos_url":"https://api.github.com/users/Seneral/repos","events_url":"https://api.github.com/users/Seneral/events{/privacy}","received_events_url":"https://api.github.com/users/Seneral/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/labels/Current%20Focus","name":"Current Focus","color":"5319e7"},{"url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/labels/Difficulty%20High","name":"Difficulty High","color":"e11d21"},{"url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2016-02-18T18:36:55Z","updated_at":"2016-02-21T18:29:00Z","closed_at":null,"body":"**Description:** A generic node for calling actions, both static and instance. The Inputs and Outputs should adapt automatically.\r\n\r\n**Progress:** Currently put on hold because we are unable to just serialize a function. I'm adressing this with a UnityFunc, which is serializeable and also needed for the StateMachine. Kamigaku on the forums has a specialised version already running afaik:)\r\n\r\n**Location:** Due to the dependecny on UnityFunc, mostlyUnityFunc.cs and UnityFuncEditor.cs\r\n\r\n**Branch:** feature/WIP_UnityFunc"},"comment":{"url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/issues/comments/186881094","html_url":"https://github.com/Baste-RainGames/Node_Editor/issues/37#issuecomment-186881094","issue_url":"https://api.github.com/repos/Baste-RainGames/Node_Editor/issues/37","id":186881094,"user":{"login":"Kamigaku","id":1123131,"avatar_url":"https://avatars.githubusercontent.com/u/1123131?v=3","gravatar_id":"","url":"https://api.github.com/users/Kamigaku","html_url":"https://github.com/Kamigaku","followers_url":"https://api.github.com/users/Kamigaku/followers","following_url":"https://api.github.com/users/Kamigaku/following{/other_user}","gists_url":"https://api.github.com/users/Kamigaku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kamigaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kamigaku/subscriptions","organizations_url":"https://api.github.com/users/Kamigaku/orgs","repos_url":"https://api.github.com/users/Kamigaku/repos","events_url":"https://api.github.com/users/Kamigaku/events{/privacy}","received_events_url":"https://api.github.com/users/Kamigaku/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T18:29:00Z","updated_at":"2016-02-21T18:29:00Z","body":"Ok i think i have setup up what you asked. I'm not sure i have done the correct way because : \r\n\r\n- I load it only once, it's pretty long (not that long but we can't afford to load it every time an ActionNode is created)\r\n- I don't use your BuildCommand class, maybe i can but i haven't checked how you use it.\r\n\r\nBasicly when the NodeEditor is loaded in preload all the static functions from all the Assemblies of the CurrentDomain. It does a very nice work and all the static functions are shown. Is that what you needed ? \r\nRight now i don't know if i should push my code or send it to you so... Here are the modifications : \r\n\r\n--------------------------------------------\r\nNodeEditorWindow.cs, inside the CreateEditor function :\r\n`NodeEditor.initializeAssemblies();`\r\n\r\n--------------------------------------------\r\nNodeEditor.cs, add the following code :\r\n\r\n`public static UnityEditor.GenericMenu assembliesMenu = new UnityEditor.GenericMenu();\r\n\r\n        /// <summary>\r\n        /// Initiliaze all the assemblies once at editor opening\r\n        /// </summary>\r\n        public static void initializeAssemblies() { \r\n            Assembly[] allAssemblies = AppDomain.CurrentDomain.GetAssemblies();\r\n            for(int i = 0; i < allAssemblies.Length; i++) {\r\n                foreach(Type type in allAssemblies[i].GetTypes()) {\r\n                    if (type.Namespace != null) {\r\n                        MethodInfo[] allStaticMethods = type.GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly);\r\n                        for (int j = 0; j < allStaticMethods.Length; j++) {\r\n                            assembliesMenu.AddItem(new GUIContent(type.Namespace.Replace('.', '/') + \"/\" + type.Name + \"/\" + allStaticMethods[j].Name), true, SelectedAssembly, allStaticMethods[j]);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            Debug.Log(\"Done loading assemblies\");\r\n        }\r\n\r\n        private static void SelectedAssembly(object methodInfo) {\r\n            MethodInfo methodToCall = methodInfo as MethodInfo;\r\n            Debug.Log(\"I will call \" + methodToCall.Name);\r\n        }`\r\n\r\n---------------------------------------\r\nInside the ActionNode.cs, just to display, add this on the OnGui method (where ever you want) :\r\n\r\n```\r\nGUILayout.BeginHorizontal();\r\n        if(GUILayout.Button(\"Pick Assembly\")) {\r\n            NodeEditor.assembliesMenu.ShowAsContext();\r\n        }\r\n        GUILayout.EndHorizontal();\r\n```\r\n\r\nTell me if it's okay for you :)"}}