Exemplo n.º 1
0
 private IEnumerator AsyncEachChildUpdateImpl(DrawerUpdateParameters parameters, int executeMultiplier = 1)
 {
     foreach (var child in Children)
     {
         yield return(CreateAsyncUpdateImplRoutine(child, parameters, executeMultiplier));
     }
 }
Exemplo n.º 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));
 }
Exemplo n.º 3
0
 private void EachChildUpdate(DrawerUpdateParameters parameters)
 {
     foreach (var child in Children)
     {
         child.Update(parameters);
     }
 }
Exemplo n.º 4
0
 private void DrawersUpdateIfNeeded(bool async, DrawerUpdateParameters parameters)
 {
     if (!drawersNeedUpdate)
     {
         return;
     }
     DrawersUpdate(async, parameters);
     drawersNeedUpdate = false;
 }
Exemplo n.º 5
0
        private void DeinitSearchFilter()
        {
            EndSearch();

            drawerSearchUpdateParameters = null;

            searchFilter.SearchTextApplied  -= OnSearchTextApplied;
            searchFilter.SearchTextApplying -= OnSearchTextApplying;
            searchFilter.SearchTextChanging -= OnSearchTextChanging;
        }
Exemplo n.º 6
0
        private void InitSearchFilter()
        {
            searchFilter.SearchTextChanging += OnSearchTextChanging;
            searchFilter.SearchTextApplying += OnSearchTextApplying;
            searchFilter.SearchTextApplied  += OnSearchTextApplied;

            drawerSearchUpdateParameters = new DrawerUpdateParameters
            {
                MaxDepth   = Settings.SearchDepth,
                DeepUpdate = true,
                ChildrenUpdatePrecondition = ChildrenUpdatePreconditionDuringSearch
            };
        }
Exemplo n.º 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();
        }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 10
0
        public void Update(DrawerUpdateParameters parameters)
        {
            if (DepthInHierarchy > parameters.MaxDepth)
            {
                return;
            }

            SelfUpdate();

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

                if (CanEachChildUpdate(parameters.DeepUpdate))
                {
                    EachChildUpdate(parameters);
                }
            }
        }
Exemplo n.º 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"));
                }
            }
        }
Exemplo n.º 12
0
 private void DrawersUpdateImmediate(bool async, DrawerUpdateParameters parameters)
 {
     DrawersUpdate(async, parameters);
     drawersNeedUpdate = false;
 }