Unity3D2Babylon.ExporterWindow.CreateEditorComponent_CS C# (CSharp) Method

CreateEditorComponent_CS() private method

private CreateEditorComponent_CS ( ) : void
return void
        public static void CreateEditorComponent_CS()
        {
            string path = AssetDatabase.GetAssetPath(Selection.activeObject);
            if (String.IsNullOrEmpty(path))
            {
                path = "Assets";
            }
            else if (!String.IsNullOrEmpty(Path.GetExtension(path)))
            {
                path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), "");
            }
            string filename = Path.Combine(path, "NewScriptComponent.cs");
            string template = "Assets/Babylon/Templates/Scripts/editorb.template";
            if (!File.Exists(template))
            {
                string defaultTemplate = "// Babylon Script Class";
                File.WriteAllText(template, defaultTemplate);
            }
            var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon") as Texture2D;
            var DoCreateScriptAsset = Type.GetType("UnityEditor.ProjectWindowCallback.DoCreateScriptAsset, UnityEditor");
            ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance(DoCreateScriptAsset) as UnityEditor.ProjectWindowCallback.EndNameEditAction, filename, icon, template);
        }