Exemple #1
0
        static void AddEntityViewToTheSuitableEngines(Dictionary <Type, FasterList <IHandleEntityViewEngine> > entityViewEngines, ITypeSafeList entityViewsList, Type entityViewType)
        {
            FasterList <IHandleEntityViewEngine> enginesForEntityView;

            if (entityViewEngines.TryGetValue(entityViewType, out enginesForEntityView))
            {
                int viewsCount;

                var entityViews = entityViewsList.ToArrayFast(out viewsCount);

                for (int i = 0; i < viewsCount; i++)
                {
                    int count;
                    var fastList = FasterList <IHandleEntityViewEngine> .NoVirt.ToArrayFast(enginesForEntityView, out count);

                    IEntityView entityView = entityViews[i];
                    for (int j = 0; j < count; j++)
                    {
#if ENGINE_PROFILER_ENABLED && UNITY_EDITOR
                        EngineProfiler.MonitorAddDuration(fastList[j], entityView);
#else
                        fastList[j].Add(entityView);
#endif
                    }
                }
            }
        }
Exemple #2
0
        void AddNodeToTheSuitableEngines(INode node, Type nodeType)
        {
            FasterList <IEngine> enginesForNode;

            if (_nodeEngines.TryGetValue(nodeType, out enginesForNode))
            {
                for (int j = 0; j < enginesForNode.Count; j++)
                {
#if ENGINE_PROFILER_ENABLED && UNITY_EDITOR
                    EngineProfiler.MonitorAddDuration(AddNodeToEngine, enginesForNode[j] as INodeEngine, node);
#else
                    (enginesForNode[j] as INodeEngine).Add(node);
#endif
                }
            }
        }