Esempio n. 1
0
 private static void Initilize()
 {
     if (!initializer.IsValidRepo && EditorUtility.DisplayDialog("Initialize Repository", "Are you sure you want to initialize a Repository for your project", "Yes", "Cancel"))
     {
         initializer.InitializeRepositoryAndRecompile();
     }
 }
Esempio n. 2
0
        protected virtual void ConstructGUI(VisualElement root)
        {
            root.styleSheets.Add(resourceManager.LoadUniGitAsset <StyleSheet>("Editor/UI/RootSheet.uss"));

            invalidRepoElement   = root.Q("InvalidRepository");
            invalidRepoPathLabel = invalidRepoElement.Q <Label>("RepoPath");
            var findRepositoryButton  = invalidRepoElement.Q <Button>("FindRepository");
            var invalidRepoHelpButton = invalidRepoElement.Q <Button>("Help");

            invalidRepoHelpButton.clickable.clicked += () => GitLinks.GoTo(GitLinks.ConfigurationHelp);

            invalidRepoElement.styleSheets.Add(resourceManager.LoadUniGitAsset <StyleSheet>("Editor/UI/InvalidRepositorySheet.uss"));
            if (invalidRepoElement != null)
            {
                invalidRepoElement.Q <Button>("CreateRepository").clickable.clicked += () =>
                {
                    if (!initializer.IsValidRepo)
                    {
                        initializer.InitializeRepositoryAndRecompile();
                    }
                };
            }

            findRepositoryButton.clickable.clicked += () =>
            {
                settingsManager.ShowChooseMainRepositoryPathPopup(this);
            };

            invalidRepoPathLabel.text = this.paths.RepoPath;
        }