void OnGUI()
    {
        UnityPathSelectionInfo.Get(out m_pathFound, out m_selector);
        GUILayout.Label("Package.json: " + m_selector.GetRelativePath(false), EditorStyles.boldLabel);
        PackageJsonFileStream f = PackageJsonUtility.GetPackageFile(m_selector);

        QuickGit.GetGitInParents(m_selector.GetAbsolutePath(false), QuickGit.PathReadDirection.LeafToRoot,
                                 out m_gitLink);
        DrawEditorDefaultInterface(m_selector, f, ref m_builder, ref m_jsonProposition, ref m_raw, ref m_hide);
    }
예제 #2
0
    void OnGUI()
    {
        UnityPathSelectionInfo.Get(out m_pathFound, out m_selector);
        GUILayout.Label("Read Me: " + m_selector.GetRelativePath(false), EditorStyles.boldLabel);
        ReadMeFileStream f = ReadMeUtility.GetReadMeFile(m_selector);

        QuickGit.GetGitInParents(m_selector.GetAbsolutePath(false), QuickGit.PathReadDirection.LeafToRoot, out m_gitLink);

        //QuickGit.GetGitInDirectory(m_selector.GetAbsolutePath(false), out m_gitLink, true);
        DrawEditorDefaultInterface(f, ref m_gitLink, ref m_text, ref m_hide);
    }
예제 #3
0
    void OnGUI()
    {
        if (GUILayout.Button("Lock Selection: " + m_lockState))
        {
            m_lockState = !m_lockState;
        }
        if (!Directory.Exists(m_selector.GetAbsolutePath(true)))
        {
            m_lockState = false;
        }

        if (!m_lockState)
        {
            UnityPathSelectionInfo.Get(out m_pathFound, out m_selector);
        }
        string previous = m_info.m_focusPath;

        m_info.m_focusPath = m_selector.GetAbsolutePath(true);
        if (previous != m_info.m_focusPath)
        {
            RefreshAccess();
        }


        EditorGUILayout.TextField(m_selector.GetRelativePath(true));
        EditorGUILayout.TextField(m_selector.GetAbsolutePath(true));

        m_info.m_scollrPackagePosition = GUILayout.BeginScrollView(m_info.m_scollrPackagePosition);
        GUILayout.Label("Welcome", EditorStyles.boldLabel);
        GUILayout.Label("This window allow you to read write config package.");
        GUILayout.Space(10);

        m_info.m_hideHiddenTool = EditorGUILayout.Foldout(m_info.m_hideHiddenTool, m_info.m_hideHiddenTool ? "→ Doc & Sample" : "↓ Doc & Sample", EditorStyles.boldLabel);
        if (!m_info.m_hideHiddenTool)
        {
            ToggleAndCreateHiddenFolder();
        }

        ReadMeEditor.DrawEditorDefaultInterface(m_info.m_readMe, ref m_info.m_gitLink, ref m_info.m_tmpReadMeText, ref m_info.m_tmpReadMeHide);

        ChangeLogEditor.DrawEditorDefaultInterface(m_info.m_changelog, ref m_info.m_tmpLogVersion, ref m_info.m_tmpLogTitle, ref m_info.m_tmpLogNew, ref m_info.m_tmpLogHide);

        LicenseEditor.DrawEditorDefaultInterface(m_info.m_license, ref m_info.m_tmpLicenseLink, ref m_info.m_tmpLicenseText, ref m_info.tmpLicenseHide);



        //CreatePackageDirectories();
        GUILayout.EndScrollView();
    }
 void OnGUI()
 {
     UnityPathSelectionInfo.Get(out m_pathFound, out m_selector);
     GUILayout.Label("Focus: " + m_selector.GetRelativePath(false), EditorStyles.boldLabel);
     DrawEditorDefaultInterface(new ChangeLogFileStream(m_selector.GetAbsolutePath(false)), ref m_version, ref m_title, ref m_logs, ref m_hide);
 }
예제 #5
0
    void OnGUI()
    {
        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Back-up:", EditorStyles.boldLabel);
        if (GUILayout.Button("Save"))
        {
            WindowPlayerPref.Save("PackageBasicBuilderBackup", JsonUtility.ToJson(m_info));
        }
        if (WindowPlayerPref.Has("PackageBasicBuilderBackup") && GUILayout.Button("Load"))
        {
            try
            {
                string json = WindowPlayerPref.Load("PackageBasicBuilderBackup");
                Info   i    = JsonUtility.FromJson <Info>(json);
                if (i != null)
                {
                    m_info = i;
                }
            }
            catch (Exception) { }
        }

        EditorGUILayout.EndHorizontal();

        m_info.m_selector    = null;
        m_info.m_targetedGit = null;
        UnityPathSelectionInfo.Get(out m_info.m_selectorpathFound, out m_info.m_selector);
        AccessGitWithPathSelector.GetAffectedGit(m_info.m_selector, out m_info.m_targetedGit);

        if (m_info.m_targetedGit != null)
        {
            string p = m_info.m_targetedGit.GetRelativeDirectoryPath();
            m_info.m_selector = new UnityPathSelectionInfo(p);
        }

        EditorGUILayout.HelpBox("Reminder: Git must be install and Git.exe must be add in System Variable Path.", MessageType.Warning, true);
        m_info.m_packageTargeted = PackageJsonUtility.GetPackageFile(m_info.m_selector);



        if (GUILayout.Button("Select: " + m_info.m_selector.GetSelectName(false)))
        {
            m_info.m_selector.Open();
        }
        if (m_info.m_targetedGit == null)
        {
            string path = m_info.m_selector.GetAbsolutePath(true);

            if (GUILayout.Button("Git Init. in " + m_info.m_selector.GetSelectName(true)))
            {
                QuickGit.CreateLocal(path);
            }
            GitForFacilitationEditor.ProposeCloneProject(m_info.m_selector, ref m_info.m_tmpCloneProposed);
            GitForFacilitationEditor.ProposeToCreateFolder(m_info.m_selector, ref m_info.m_tmpFolderToCreate);
        }
        else
        {
            if (!m_info.m_targetedGit.IsHosted())
            {
                GitForFacilitationEditor.PushLocalGitToOnlineAccount(m_info.m_targetedGit,
                                                                     ref m_info.m_userNameToCreateGit,
                                                                     ref m_info.m_projectNameToCreate,
                                                                     ref m_info.m_dropDownSelectionServer,
                                                                     ref m_info.m_hideGitUtilitary);
            }
            GUILayout.Space(20);
            if (GUILayout.Button("Git: " + m_info.m_selector.GetSelectName(true), EditorStyles.boldLabel))
            {
                Application.OpenURL(m_info.m_selector.GetAbsolutePath(false));
            }
            if (QuickGit.IsPathHasGitRootFolder(m_info.m_selector.GetAbsolutePath(true)))
            {
                GitEditorDrawer.DisplayGitCommands(m_info.m_targetedGit);
                UnityPackageEditorDrawer.DrawPackageDownUpButton(m_info.m_targetedGit, true);
            }
            PackageJsonEditor.DrawEditorDefaultInterface(m_info.m_selector, m_info.m_packageTargeted, ref m_info.m_packageBuilder, ref m_info.m_tmpPackageJsonProposition, ref m_info.m_tmp_rawDisplayJsonPackage, ref m_info.m_hidePackageBuilder);;
        }
    }
예제 #6
0
    void OnGUI()
    {
        if (m_info == null)
        {
            m_info = new Info();
        }

        bool   foundPath    = false;
        string previousPath = m_info.m_directoryRelative;
        UnityPathSelectionInfo selected;

        UnityPathSelectionInfo.Get(out foundPath, out selected);
        m_info.m_directoryRelative = selected.GetRelativePath(true);
        m_info.m_directoryAbsolute = selected.GetAbsolutePath(true);
        bool changeFound = m_info.m_directoryRelative != previousPath;

        bool resquestRefresh = GUILayout.Button("Refresh");

        if (resquestRefresh || changeFound)
        {
            m_gitInProject.Refresh();
            m_info.m_gitLinksPath = QuickGit.GetAllFolders(m_info.m_directoryAbsolute, true);
            QuickGit.GetGitsInDirectory(m_info.m_directoryAbsolute, out m_info.m_gitLinks);
            m_info.m_projectGitInParent = "";
            GitLinkOnDisk gd;
            QuickGit.GetGitInParents(selected.GetAbsolutePath(true), QuickGit.PathReadDirection.LeafToRoot, out gd);
            if (gd != null)
            {
                m_info.m_projectGitInParent = gd.GetDirectoryPath();
            }
        }


        EditorGUILayout.TextField("Relative >", m_info.m_directoryRelative);
        EditorGUILayout.TextField("Abosluete > ", m_info.m_directoryAbsolute);

        // if (foundPath)
        {
            if (!string.IsNullOrEmpty(m_info.m_projectGitInParent))
            {
                EditorGUILayout.TextField("Parent Git", m_info.m_projectGitInParent.Length <= 0?"Project is not in a git.": m_info.m_projectGitInParent);
            }

            m_info.m_displayAllFolder = EditorGUILayout.Toggle("All Directory", m_info.m_displayAllFolder);
            if (m_info.m_displayAllFolder)
            {
                for (int i = 0; i < m_info.m_gitLinksPath.Length; i++)
                {
                    m_info.m_gitLinksPath[i] = EditorGUILayout.TextField("Directory", m_info.m_gitLinksPath[i]);
                }
            }

            m_info.m_displayAllGitInFolder = EditorGUILayout.Toggle("All Repository", m_info.m_displayAllGitInFolder);
            if (m_info.m_displayAllGitInFolder)
            {
                for (int i = 0; i < m_info.m_gitLinks.Count; i++)
                {
                    GitEditorDrawer.DisplayGitInfoWithCommand(m_info.m_gitLinks[i], ref m_info.m_displayprojectsInfo[i], ref m_info.m_displayInfoInGits[i]);
                    EditorGUILayout.Space();
                }
            }
        }

        GUILayout.BeginHorizontal();
        GitEditorDrawer.ButtonDeleteEmptyFiles(m_info.m_directoryAbsolute);
        GitEditorDrawer.ButtonRefreshGitKeeper(m_info.m_directoryAbsolute);
        GUILayout.EndHorizontal();
    }
예제 #7
0
 public static void GetSelectedPathInUnity(out bool found, out UnityPathSelectionInfo info)
 {
     UnityPathSelectionInfo.Get(out found, out info);
 }
예제 #8
0
 void OnGUI()
 {
     UnityPathSelectionInfo.Get(out m_pathFound, out m_selector);
     DrawEditorDefaultInterface(new LicenseFileStream(m_selector.GetAbsolutePath(false)), ref m_licenseLink, ref m_licenseText, ref m_hide);
 }