コード例 #1
0
    public static List <GitUnityPackageLinkOnDisk> GetGitUnityPackageInDirectory(string directoryPath)
    {
        List <GitLinkOnDisk> links;

        QuickGit.GetGitsInDirectory(directoryPath, out links);
        return(GetGitUnityPackageInDirectory(links));
    }
コード例 #2
0
    public void Refresh()
    {
        string assetPath = UnityPaths.GetUnityAssetsPath();

        QuickGit.GetGitsInParents(assetPath, out m_inParentsPath);
        QuickGit.GetGitsInDirectory(assetPath, out m_inTheProject, true);
    }
コード例 #3
0
 private void Reset()
 {
     if (string.IsNullOrEmpty(m_directory))
     {
         m_directory = Application.dataPath + "/../";
     }
     m_gitLinksPath = QuickGit.GetAllFolders(m_directory, true);
     QuickGit.GetGitsInDirectory(m_directory, out m_gitLinks);
     m_packageInfo = UnityPackageUtility.GetGitUnityPackageInDirectory(m_directory);
 }
コード例 #4
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();
    }