private void UpdateEditor()
        {
            bool repaint = false;

            if (_tester.Testing)
            {
                _tester.Update();
                repaint = true;
            }

            //All just to get a damn warning message updating properly.
            double timeSinceButtonPress = EditorApplication.timeSinceStartup - _addTime;

            if (timeSinceButtonPress < _minimumAddTimeBeforeFeedback)
            {
                lastFrameWasWaitingToShowWarning = true;
            }
            else if (lastFrameWasWaitingToShowWarning)
            {
                repaint = true;
                lastFrameWasWaitingToShowWarning = false;
            }

            _reposBusy.Clear();
            foreach (GUIRepositoryPanel panel in _repoPanels)
            {
                if (panel.Update())
                {
                    repaint = true;
                }

                if (panel.Busy())
                {
                    _reposBusy.Add(panel);
                }
            }

            List <GUIRepositoryPanel> updatedRepos = new List <GUIRepositoryPanel>();

            //Repos just finished updating. Time to copy.
            foreach (GUIRepositoryPanel panel in _repoPanels)
            {
                //check what repos just finished updating
                if (_reposWereBusy.Contains(panel) && !_reposBusy.Contains(panel))
                {
                    updatedRepos.Add(panel);
                }
            }

            if (repaint)
            {
                Repaint();
            }

            _reposWereBusy = new HashSet <GUIRepositoryPanel>(_reposBusy);
        }
예제 #2
0
        private void UpdateEditor()
        {
            bool repaint = false;

            if (_tester.Testing)
            {
                _tester.Update();
                repaint = true;
            }

            //All just to get a damn warning message updating properly.
            double timeSinceButtonPress = EditorApplication.timeSinceStartup - _addTime;

            if (timeSinceButtonPress < _minimumAddTimeBeforeFeedback)
            {
                lastFrameWasWaitingToShowWarning = true;
            }
            else if (lastFrameWasWaitingToShowWarning)
            {
                repaint = true;
                lastFrameWasWaitingToShowWarning = false;
            }

            _reposBusy.Clear();
            foreach (RepoPanel panel in _repoPanels)
            {
                if (panel.Update())
                {
                    repaint = true;
                }

                if (panel.Busy())
                {
                    _reposBusy.Add(panel);
                }
            }


            List <string>    coppiedAssets = new List <string>();
            List <RepoPanel> updatedRepos  = new List <RepoPanel>();

            //Repos just finished updating. Time to copy.
            foreach (RepoPanel panel in _repoPanels)
            {
                //check what repos just finished updating
                if (_reposWereBusy.Contains(panel) && !_reposBusy.Contains(panel))
                {
                    updatedRepos.Add(panel);
                    coppiedAssets.AddRange(panel.CopyRepository());
                }
            }

            if (coppiedAssets.Count > 0)
            {
                UpdateAssetDatabaseForNewAssets(coppiedAssets, EditorPrefs.GetBool(FULL_RE_IMPORT_KEY, true), updatedRepos.ToArray());
            }

            if (repaint)
            {
                Repaint();
            }

            _reposWereBusy = new HashSet <RepoPanel>(_reposBusy);
        }