コード例 #1
0
ファイル: Finder.cs プロジェクト: sschoener/unity-commander
        private void Update()
        {
            if (_searchTriggerTimer.Update())
            {
                UpdateSearch();
            }
            var newSearchState = GetSearchState();

            if (!_searchProgress.Equals(newSearchState))
            {
                _searchProgress = newSearchState;
                if (SearchStateChanged != null)
                {
                    SearchStateChanged(_searchProgress);
                }
            }

            if (_incomingData == null)
            {
                return;
            }

            int numNew = _incomingData.EmptyTo(_resultData);

            if (numNew > 0)
            {
                _resultDisplay.CheckForNew();
            }
        }
コード例 #2
0
        private void OnSearchStateChanged(SearchProgress search)
        {
            if (search.NoSearch)
            {
                _infoLabel.CheapDisable();
                return;
            }
            _infoLabel.CheapEnable();
            int n     = search.NumResults;
            var label = n.ToString();

            if (search.InProgress)
            {
                label += "+";
            }
            if (n != 1 || search.InProgress)
            {
                _infoLabel.text = label + " results";
            }
            else
            {
                _infoLabel.text = label + " result";
            }
        }