Пример #1
0
 private IEnumerator AsyncEachChildUpdateImpl(DrawerUpdateParameters parameters, int executeMultiplier = 1)
 {
     foreach (var child in Children)
     {
         yield return(CreateAsyncUpdateImplRoutine(child, parameters, executeMultiplier));
     }
 }
Пример #2
0
 private static SHCoroutine CreateAsyncUpdateImplRoutine(
     Drawer drawer, DrawerUpdateParameters parameters, int executeMultiplier)
 {
     return(new SHCoroutine(
                drawer.AsyncUpdateImpl(parameters, executeMultiplier),
                drawer.HierarchicalName + "+AsyncUpdateImpl", executeMultiplier, drawer.OnAsyncUpdateDone));
 }
Пример #3
0
 private void EachChildUpdate(DrawerUpdateParameters parameters)
 {
     foreach (var child in Children)
     {
         child.Update(parameters);
     }
 }
Пример #4
0
 private void DrawersUpdateIfNeeded(bool async, DrawerUpdateParameters parameters)
 {
     if (!drawersNeedUpdate)
     {
         return;
     }
     DrawersUpdate(async, parameters);
     drawersNeedUpdate = false;
 }
Пример #5
0
        private void DeinitSearchFilter()
        {
            EndSearch();

            drawerSearchUpdateParameters = null;

            searchFilter.SearchTextApplied  -= OnSearchTextApplied;
            searchFilter.SearchTextApplying -= OnSearchTextApplying;
            searchFilter.SearchTextChanging -= OnSearchTextChanging;
        }
Пример #6
0
        private void InitSearchFilter()
        {
            searchFilter.SearchTextChanging += OnSearchTextChanging;
            searchFilter.SearchTextApplying += OnSearchTextApplying;
            searchFilter.SearchTextApplied  += OnSearchTextApplied;

            drawerSearchUpdateParameters = new DrawerUpdateParameters
            {
                MaxDepth   = Settings.SearchDepth,
                DeepUpdate = true,
                ChildrenUpdatePrecondition = ChildrenUpdatePreconditionDuringSearch
            };
        }
Пример #7
0
        public void AsyncUpdate(DrawerUpdateParameters parameters, int executeMultiplier = 1, Action done = null)
        {
            if (DepthInHierarchy > parameters.MaxDepth)
            {
                return;
            }

            StopAsyncUpdate();

            asyncUpdateDone    = done;
            asyncUpdateRoutine = CreateAsyncUpdateImplRoutine(this, parameters, executeMultiplier);
            asyncUpdateRoutine.Start();
        }
Пример #8
0
 private void DrawersUpdate(bool async, DrawerUpdateParameters parameters)
 {
     for (int i = 0; i < RootValueDrawerCount; ++i)
     {
         var drawer = rootValueDrawers[i];
         if (async)
         {
             drawer.AsyncUpdate(parameters);
         }
         else
         {
             drawer.Update(parameters);
         }
     }
 }
Пример #9
0
        private bool CanChildrenUpdate(DrawerUpdateParameters parameters)
        {
            if (DepthInHierarchy > parameters.MaxDepth)
            {
                return(false);
            }

            var precondition = parameters.ChildrenUpdatePrecondition;

            if (precondition != null && !precondition(this))
            {
                return(false);
            }

            return(true);
        }
Пример #10
0
        public void Update(DrawerUpdateParameters parameters)
        {
            if (DepthInHierarchy > parameters.MaxDepth)
            {
                return;
            }

            SelfUpdate();

            if (CanChildrenUpdate(parameters))
            {
                ChildrenUpdate();

                if (CanEachChildUpdate(parameters.DeepUpdate))
                {
                    EachChildUpdate(parameters);
                }
            }
        }
Пример #11
0
        private IEnumerator AsyncUpdateImpl(DrawerUpdateParameters parameters, int executeMultiplier = 1)
        {
            if (DepthInHierarchy > parameters.MaxDepth)
            {
                yield break;
            }

            SelfUpdate();
            yield return(null);

            if (CanChildrenUpdate(parameters))
            {
                ChildrenUpdate();

                if (CanEachChildUpdate(parameters.DeepUpdate))
                {
                    yield return(new SHCoroutine(
                                     AsyncEachChildUpdateImpl(parameters, executeMultiplier),
                                     HierarchicalName + "+AsyncEachChildUpdateImpl"));
                }
            }
        }
Пример #12
0
 private void DrawersUpdateImmediate(bool async, DrawerUpdateParameters parameters)
 {
     DrawersUpdate(async, parameters);
     drawersNeedUpdate = false;
 }