< Summary

Class:DCL.ECSComponentsManagerLegacy
Assembly:ECSComponentManagerLegacy
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/ECSComponentManagerLegacy/ECSComponentsManagerLegacy.cs
Covered lines:199
Uncovered lines:52
Coverable lines:251
Total lines:628
Line coverage:79.2% (199 of 251)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ECSComponentsManagerLegacy(...)0%110100%
ECSComponentsManagerLegacy(...)0%110100%
AddSharedComponent(...)0%3.023087.5%
RemoveSharedComponent(...)0%6.026091.67%
TryGetComponent[T](...)0%7.057090%
TryGetBaseComponent(...)0%220100%
TryGetSharedComponent(...)0%440100%
GetSharedComponent(...)0%3.073080%
HasComponent(...)0%220100%
HasSharedComponent(...)0%220100%
RemoveComponent(...)0%330100%
AddComponent(...)0%220100%
GetComponent(...)0%3.583060%
GetComponents()0%30500%
GetSharedComponents()0%14.115028.57%
GetComponentsDictionary(...)0%110100%
GetSharedComponentsDictionary(...)0%110100%
GetComponentsCount()0%6200%
CleanComponents(...)0%770100%
HasSceneSharedComponent(...)0%110100%
GetSceneSharedComponent(...)0%110100%
TryGetSceneSharedComponent(...)0%2100%
GetSceneSharedComponentsDictionary()0%110100%
GetSceneSharedComponentsCount()0%110100%
AddSceneSharedComponent(...)0%220100%
RemoveSceneSharedComponent(...)0%2100%
SceneSharedComponentCreate(...)0%5.125083.33%
GetSceneSharedComponent[T]()0%220100%
SceneSharedComponentAttach(...)0%330100%
EntityComponentCreateOrUpdate(...)0%9.049092.31%
EntityComponentUpdate(...)0%3.793055.56%
SceneSharedComponentDispose(...)0%330100%
SceneSharedComponentUpdate(...)0%5.23037.5%
SceneSharedComponentUpdate(...)0%5.23037.5%
EntityComponentRemove(...)0%40.0133081.4%
DisposeAllSceneComponents()0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/ECSComponentManagerLegacy/ECSComponentsManagerLegacy.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using DCL.Components;
 5using DCL.Controllers;
 6using DCL.Helpers;
 7using DCL.Models;
 8using DCL.Rendering;
 9using UnityEngine;
 10
 11namespace DCL
 12{
 13    public class ECSComponentsManagerLegacy : IECSComponentsManagerLegacy
 14    {
 56915        private readonly Dictionary<string, ISharedComponent> disposableComponents = new Dictionary<string, ISharedCompo
 16
 56917        private readonly Dictionary<long, Dictionary<Type, ISharedComponent>> entitiesSharedComponents =
 18            new Dictionary<long, Dictionary<Type, ISharedComponent>>();
 19
 56920        private readonly Dictionary<long, Dictionary<CLASS_ID_COMPONENT, IEntityComponent>> entitiesComponents =
 21            new Dictionary<long, Dictionary<CLASS_ID_COMPONENT, IEntityComponent>>();
 22
 23        private readonly IParcelScene scene;
 24        private readonly IRuntimeComponentFactory componentFactory;
 25        private readonly IParcelScenesCleaner parcelScenesCleaner;
 26        private readonly ISceneBoundsChecker sceneBoundsChecker;
 27        private readonly IPhysicsSyncController physicsSyncController;
 28        private readonly ICullingController cullingController;
 29
 30        public event Action<string, ISharedComponent> OnAddSharedComponent;
 31
 32        public ECSComponentsManagerLegacy(IParcelScene scene)
 56933            : this(scene,
 34                Environment.i.world.componentFactory,
 35                Environment.i.platform.parcelScenesCleaner,
 36                Environment.i.world.sceneBoundsChecker,
 37                Environment.i.platform.physicsSyncController,
 56938                Environment.i.platform.cullingController) { }
 39
 56940        public ECSComponentsManagerLegacy(IParcelScene scene,
 41            IRuntimeComponentFactory componentFactory,
 42            IParcelScenesCleaner parcelScenesCleaner,
 43            ISceneBoundsChecker sceneBoundsChecker,
 44            IPhysicsSyncController physicsSyncController,
 45            ICullingController cullingController)
 46        {
 56947            this.scene = scene;
 56948            this.componentFactory = componentFactory;
 56949            this.parcelScenesCleaner = parcelScenesCleaner;
 56950            this.sceneBoundsChecker = sceneBoundsChecker;
 56951            this.physicsSyncController = physicsSyncController;
 56952            this.cullingController = cullingController;
 56953        }
 54
 55        public void AddSharedComponent(IDCLEntity entity, Type componentType, ISharedComponent component)
 56        {
 46257            if (component == null)
 58            {
 059                return;
 60            }
 61
 46262            RemoveSharedComponent(entity, componentType);
 63
 46264            if (!entitiesSharedComponents.TryGetValue(entity.entityId, out Dictionary<Type, ISharedComponent> entityComp
 65            {
 33466                entityComponents = new Dictionary<Type, ISharedComponent>();
 33467                entitiesSharedComponents.Add(entity.entityId, entityComponents);
 68            }
 69
 46270            entityComponents.Add(componentType, component);
 46271        }
 72
 73        public void RemoveSharedComponent(IDCLEntity entity, Type targetType, bool triggerDetaching = true)
 74        {
 92875            if (!entitiesSharedComponents.TryGetValue(entity.entityId, out Dictionary<Type, ISharedComponent> entityComp
 76            {
 36077                return;
 78            }
 56879            if (!entityComponents.TryGetValue(targetType, out ISharedComponent component))
 80            {
 17581                return;
 82            }
 39383            if (component == null)
 084                return;
 85
 39386            entityComponents.Remove(targetType);
 87
 39388            if (entityComponents.Count == 0)
 89            {
 27290                entitiesSharedComponents.Remove(entity.entityId);
 91            }
 92
 39393            if (triggerDetaching)
 3194                component.DetachFrom(entity, targetType);
 39395        }
 96
 97        public T TryGetComponent<T>(IDCLEntity entity) where T : class
 98        {
 26499            T component = null;
 264100            if (entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> ent
 101            {
 83102                component = entityComponents.Values.FirstOrDefault(x => x is T) as T;
 103
 83104                if (component != null)
 0105                    return component;
 106            }
 107
 264108            if (entitiesSharedComponents.TryGetValue(entity.entityId, out Dictionary<Type, ISharedComponent> entityShare
 109            {
 49110                component = entitySharedComponents.Values.FirstOrDefault(x => x is T) as T;
 111
 49112                if (component != null)
 42113                    return component;
 114            }
 115
 222116            return null;
 117        }
 118
 119        public bool TryGetBaseComponent(IDCLEntity entity, CLASS_ID_COMPONENT componentId, out IEntityComponent componen
 120        {
 282121            if (entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> ent
 122            {
 73123                return entityComponents.TryGetValue(componentId, out component);
 124            }
 209125            component = null;
 209126            return false;
 127        }
 128
 129        public bool TryGetSharedComponent(IDCLEntity entity, CLASS_ID componentId, out ISharedComponent component)
 130        {
 323131            component = null;
 323132            if (!entitiesSharedComponents.TryGetValue(entity.entityId, out Dictionary<Type, ISharedComponent> entityComp
 133            {
 234134                return false;
 135            }
 136
 89137            using (var iterator = entityComponents.GetEnumerator())
 138            {
 165139                while (iterator.MoveNext())
 140                {
 114141                    if (iterator.Current.Value.GetClassId() != (int)componentId)
 142                        continue;
 143
 38144                    component = iterator.Current.Value;
 38145                    break;
 146                }
 51147            }
 148
 89149            return component != null;
 150        }
 151
 152        public ISharedComponent GetSharedComponent(IDCLEntity entity, Type targetType)
 153        {
 68154            if (!entitiesSharedComponents.TryGetValue(entity.entityId, out Dictionary<Type, ISharedComponent> entityComp
 155            {
 11156                return null;
 157            }
 158
 57159            if (entityComponents.TryGetValue(targetType, out ISharedComponent component))
 160            {
 57161                return component;
 162            }
 163
 0164            return null;
 165        }
 166
 167        public bool HasComponent(IDCLEntity entity, CLASS_ID_COMPONENT componentId)
 168        {
 694169            if (entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> ent
 170            {
 362171                return entityComponents.ContainsKey(componentId);
 172            }
 332173            return false;
 174        }
 175
 176        public bool HasSharedComponent(IDCLEntity entity, CLASS_ID componentId)
 177        {
 94178            if (TryGetSharedComponent(entity, componentId, out ISharedComponent component))
 179            {
 1180                return component != null;
 181            }
 93182            return false;
 183        }
 184
 185        public void RemoveComponent(IDCLEntity entity, CLASS_ID_COMPONENT componentId)
 186        {
 22187            if (entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> ent
 188            {
 22189                entityComponents.Remove(componentId);
 190
 22191                if (entityComponents.Count == 0)
 192                {
 17193                    entitiesComponents.Remove(entity.entityId);
 194                }
 195            }
 22196        }
 197
 198        public void AddComponent(IDCLEntity entity, CLASS_ID_COMPONENT componentId, IEntityComponent component)
 199        {
 339200            if (!entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> en
 201            {
 294202                entityComponents = new Dictionary<CLASS_ID_COMPONENT, IEntityComponent>();
 294203                entitiesComponents.Add(entity.entityId, entityComponents);
 204            }
 339205            entityComponents.Add(componentId, component);
 339206        }
 207
 208        public IEntityComponent GetComponent(IDCLEntity entity, CLASS_ID_COMPONENT componentId)
 209        {
 105210            if (!entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> en
 211            {
 0212                return null;
 213            }
 105214            if (entityComponents.TryGetValue(componentId, out IEntityComponent component))
 215            {
 105216                return component;
 217            }
 0218            return null;
 219        }
 220
 221        public IEnumerator<IEntityComponent> GetComponents(IDCLEntity entity)
 222        {
 0223            if (!entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> en
 224            {
 0225                yield break;
 226            }
 227
 0228            using (var iterator = entityComponents.GetEnumerator())
 229            {
 0230                while (iterator.MoveNext())
 231                {
 0232                    yield return iterator.Current.Value;
 233                }
 0234            }
 0235        }
 236
 237        public IEnumerator<ISharedComponent> GetSharedComponents(IDCLEntity entity)
 238        {
 4239            if (!entitiesSharedComponents.TryGetValue(entity.entityId, out Dictionary<Type, ISharedComponent> entityComp
 240            {
 4241                yield break;
 242            }
 243
 0244            using (var iterator = entityComponents.GetEnumerator())
 245            {
 0246                while (iterator.MoveNext())
 247                {
 0248                    yield return iterator.Current.Value;
 249                }
 0250            }
 0251        }
 252
 253        public IReadOnlyDictionary<CLASS_ID_COMPONENT, IEntityComponent> GetComponentsDictionary(IDCLEntity entity)
 254        {
 38255            entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> entityC
 38256            return entityComponents;
 257        }
 258
 259        public IReadOnlyDictionary<Type, ISharedComponent> GetSharedComponentsDictionary(IDCLEntity entity)
 260        {
 4261            entitiesSharedComponents.TryGetValue(entity.entityId, out Dictionary<Type, ISharedComponent> entityComponent
 4262            return entityComponents;
 263        }
 264
 265        public int GetComponentsCount()
 266        {
 0267            int count = 0;
 0268            using (var entityIterator = entitiesComponents.GetEnumerator())
 269            {
 0270                while (entityIterator.MoveNext())
 271                {
 0272                    count += entityIterator.Current.Value.Count;
 273                }
 0274            }
 0275            return count;
 276        }
 277
 278        public void CleanComponents(IDCLEntity entity)
 279        {
 530280            if (!entitiesComponents.TryGetValue(entity.entityId, out Dictionary<CLASS_ID_COMPONENT, IEntityComponent> en
 281            {
 320282                return;
 283            }
 284
 210285            using (var iterator = entityComponents.GetEnumerator())
 286            {
 436287                while (iterator.MoveNext())
 288                {
 226289                    if (iterator.Current.Value == null)
 290                        continue;
 291
 226292                    if (iterator.Current.Value is ICleanable cleanableComponent)
 226293                        cleanableComponent.Cleanup();
 294
 226295                    if (!(iterator.Current.Value is IPoolableObjectContainer poolableContainer))
 296                        continue;
 297
 50298                    if (poolableContainer.poolableObject == null)
 299                        continue;
 300
 4301                    poolableContainer.poolableObject.Release();
 302                }
 210303            }
 210304            entitiesComponents.Remove(entity.entityId);
 210305        }
 306
 307        public bool HasSceneSharedComponent(string component)
 308        {
 189309            return disposableComponents.ContainsKey(component);
 310        }
 311
 312        public ISharedComponent GetSceneSharedComponent(string component)
 313        {
 810314            disposableComponents.TryGetValue(component, out ISharedComponent sharedComponent);
 810315            return sharedComponent;
 316        }
 317
 318        public bool TryGetSceneSharedComponent(string component, out ISharedComponent sharedComponent)
 319        {
 0320            return disposableComponents.TryGetValue(component, out sharedComponent);
 321        }
 322
 323        public IReadOnlyDictionary<string, ISharedComponent> GetSceneSharedComponentsDictionary()
 324        {
 3325            return disposableComponents;
 326        }
 327
 328        public int GetSceneSharedComponentsCount()
 329        {
 528330            return disposableComponents.Count;
 331        }
 332
 333        public void AddSceneSharedComponent(string component, ISharedComponent sharedComponent)
 334        {
 648335            disposableComponents.Add(component, sharedComponent);
 648336            OnAddSharedComponent?.Invoke(component, sharedComponent);
 4337        }
 338
 339        public bool RemoveSceneSharedComponent(string component)
 340        {
 0341            return disposableComponents.Remove(component);
 342        }
 343
 344        public ISharedComponent SceneSharedComponentCreate(string id, int classId)
 345        {
 648346            if (disposableComponents.TryGetValue(id, out ISharedComponent component))
 4347                return component;
 348
 644349            IRuntimeComponentFactory factory = componentFactory;
 350
 644351            if (factory.createConditions.ContainsKey(classId))
 352            {
 44353                if (!factory.createConditions[(int)classId].Invoke(scene.sceneData.id, classId))
 0354                    return null;
 355            }
 356
 644357            ISharedComponent newComponent = componentFactory.CreateComponent(classId) as ISharedComponent;
 358
 644359            if (newComponent == null)
 0360                return null;
 361
 644362            AddSceneSharedComponent(id, newComponent);
 363
 644364            newComponent.Initialize(scene, id);
 365
 644366            return newComponent;
 367        }
 368
 369        public T GetSceneSharedComponent<T>() where T : class
 370        {
 123371            return disposableComponents.Values.FirstOrDefault(x => x is T) as T;
 372        }
 373
 374        /**
 375          * This method is called when we need to attach a disposable component to the entity
 376          */
 377        public void SceneSharedComponentAttach(long entityId, string componentId)
 378        {
 466379            IDCLEntity entity = scene.GetEntityById(entityId);
 380
 466381            if (entity == null)
 2382                return;
 383
 464384            if (disposableComponents.TryGetValue(componentId, out ISharedComponent sharedComponent))
 385            {
 462386                sharedComponent.AttachTo(entity);
 387            }
 464388        }
 389
 390        public IEntityComponent EntityComponentCreateOrUpdate(long entityId, CLASS_ID_COMPONENT classId, object data)
 391        {
 417392            IDCLEntity entity = scene.GetEntityById(entityId);
 393
 417394            if (entity == null)
 395            {
 0396                Debug.LogError($"scene '{scene.sceneData.id}': Can't create entity component if the entity {entityId} do
 0397                return null;
 398            }
 399
 417400            IEntityComponent newComponent = null;
 401
 417402            var overrideCreate = Environment.i.world.componentFactory.createOverrides;
 403
 417404            if (overrideCreate.ContainsKey((int)classId))
 405            {
 342406                int classIdAsInt = (int)classId;
 342407                overrideCreate[(int)classId].Invoke(scene.sceneData.id, entityId, ref classIdAsInt, data);
 342408                classId = (CLASS_ID_COMPONENT)classIdAsInt;
 409            }
 410
 417411            if (!HasComponent(entity, classId))
 412            {
 338413                newComponent = componentFactory.CreateComponent((int)classId) as IEntityComponent;
 414
 338415                if (newComponent != null)
 416                {
 338417                    AddComponent(entity, classId, newComponent);
 418
 338419                    newComponent.Initialize(scene, entity);
 420
 338421                    if (data is string json)
 422                    {
 303423                        newComponent.UpdateFromJSON(json);
 303424                    }
 425                    else
 426                    {
 35427                        newComponent.UpdateFromModel(data as BaseModel);
 428                    }
 429                }
 35430            }
 431            else
 432            {
 79433                newComponent = EntityComponentUpdate(entity, classId, data as string);
 434            }
 435
 417436            if (newComponent != null && newComponent is IOutOfSceneBoundariesHandler)
 21437                sceneBoundsChecker?.AddEntityToBeChecked(entity);
 438
 417439            physicsSyncController.MarkDirty();
 417440            cullingController.MarkDirty();
 441
 417442            return newComponent;
 443        }
 444
 445        public IEntityComponent EntityComponentUpdate(IDCLEntity entity, CLASS_ID_COMPONENT classId,
 446            string componentJson)
 447        {
 103448            if (entity == null)
 449            {
 0450                Debug.LogError($"Can't update the {classId} component of a nonexistent entity!", scene.GetSceneTransform
 0451                return null;
 452            }
 453
 103454            if (!HasComponent(entity, classId))
 455            {
 0456                Debug.LogError($"Entity {entity.entityId} doesn't have a {classId} component to update!", scene.GetScene
 0457                return null;
 458            }
 459
 103460            var targetComponent = GetComponent(entity, classId);
 103461            targetComponent.UpdateFromJSON(componentJson);
 462
 103463            return targetComponent;
 464        }
 465
 466        public void SceneSharedComponentDispose(string id)
 467        {
 90468            if (disposableComponents.TryGetValue(id, out ISharedComponent sharedComponent))
 469            {
 90470                sharedComponent?.Dispose();
 90471                disposableComponents.Remove(id);
 472            }
 90473        }
 474
 475        public ISharedComponent SceneSharedComponentUpdate(string id, BaseModel model)
 476        {
 27477            if (disposableComponents.TryGetValue(id, out ISharedComponent sharedComponent))
 478            {
 27479                sharedComponent.UpdateFromModel(model);
 27480                return sharedComponent;
 481            }
 482
 0483            if (scene.GetSceneTransform() == null)
 484            {
 0485                Debug.LogError($"Unknown disposableComponent {id} -- scene has been destroyed?");
 0486            }
 487            else
 488            {
 0489                Debug.LogError($"Unknown disposableComponent {id}", scene.GetSceneTransform());
 490            }
 491
 0492            return null;
 493        }
 494
 495        public ISharedComponent SceneSharedComponentUpdate(string id, string json)
 496        {
 705497            if (disposableComponents.TryGetValue(id, out ISharedComponent disposableComponent))
 498            {
 705499                disposableComponent.UpdateFromJSON(json);
 705500                return disposableComponent;
 501            }
 502
 0503            if (scene.GetSceneTransform() == null)
 504            {
 0505                Debug.LogError($"Unknown disposableComponent {id} -- scene has been destroyed?");
 0506            }
 507            else
 508            {
 0509                Debug.LogError($"Unknown disposableComponent {id}", scene.GetSceneTransform());
 510            }
 511
 0512            return null;
 513        }
 514
 515        public void EntityComponentRemove(long entityId, string componentName)
 516        {
 37517            IDCLEntity entity = scene.GetEntityById(entityId);
 518
 37519            if (entity == null)
 520            {
 0521                return;
 522            }
 523
 524            switch (componentName)
 525            {
 526                case "shape":
 0527                    if (entity.meshesInfo.currentShape is BaseShape baseShape)
 528                    {
 0529                        baseShape.DetachFrom(entity);
 530                    }
 531
 0532                    return;
 533
 534                case ComponentNameLiterals.OnClick:
 535                    {
 1536                        if (TryGetBaseComponent(entity, CLASS_ID_COMPONENT.UUID_ON_CLICK, out IEntityComponent component
 537                        {
 1538                            Utils.SafeDestroy(component.GetTransform().gameObject);
 1539                            RemoveComponent(entity, CLASS_ID_COMPONENT.UUID_ON_CLICK);
 540                        }
 541
 1542                        return;
 543                    }
 544                case ComponentNameLiterals.OnPointerDown:
 545                    {
 1546                        if (TryGetBaseComponent(entity, CLASS_ID_COMPONENT.UUID_ON_DOWN, out IEntityComponent component)
 547                        {
 1548                            Utils.SafeDestroy(component.GetTransform().gameObject);
 1549                            RemoveComponent(entity, CLASS_ID_COMPONENT.UUID_ON_DOWN);
 550                        }
 551                    }
 1552                    return;
 553                case ComponentNameLiterals.OnPointerUp:
 554                    {
 1555                        if (TryGetBaseComponent(entity, CLASS_ID_COMPONENT.UUID_ON_UP, out IEntityComponent component))
 556                        {
 1557                            Utils.SafeDestroy(component.GetTransform().gameObject);
 1558                            RemoveComponent(entity, CLASS_ID_COMPONENT.UUID_ON_UP);
 559                        }
 560                    }
 1561                    return;
 562                case ComponentNameLiterals.OnPointerHoverEnter:
 563                    {
 2564                        if (TryGetBaseComponent(entity, CLASS_ID_COMPONENT.UUID_ON_HOVER_ENTER, out IEntityComponent com
 565                        {
 2566                            Utils.SafeDestroy(component.GetTransform().gameObject);
 2567                            RemoveComponent(entity, CLASS_ID_COMPONENT.UUID_ON_HOVER_ENTER);
 568                        }
 569                    }
 2570                    return;
 571                case ComponentNameLiterals.OnPointerHoverExit:
 572                    {
 2573                        if (TryGetBaseComponent(entity, CLASS_ID_COMPONENT.UUID_ON_HOVER_EXIT, out IEntityComponent comp
 574                        {
 2575                            Utils.SafeDestroy(component.GetTransform().gameObject);
 2576                            RemoveComponent(entity, CLASS_ID_COMPONENT.UUID_ON_HOVER_EXIT);
 577                        }
 578                    }
 2579                    return;
 580                case "transform":
 581                    {
 0582                        if (TryGetBaseComponent(entity, CLASS_ID_COMPONENT.AVATAR_ATTACH, out IEntityComponent component
 583                        {
 0584                            component.Cleanup();
 0585                            RemoveComponent(entity, CLASS_ID_COMPONENT.AVATAR_ATTACH);
 586                        }
 587                    }
 0588                    return;
 589
 590                default:
 591                    {
 75592                        IEntityComponent component = GetComponentsDictionary(entity).FirstOrDefault(kp => kp.Value.compo
 30593                        if (component == null)
 594                            break;
 595
 15596                        RemoveComponent(entity, (CLASS_ID_COMPONENT)component.GetClassId());
 597
 15598                        if (component is ICleanable cleanableComponent)
 15599                            cleanableComponent.Cleanup();
 600
 15601                        bool released = false;
 15602                        if (component is IPoolableObjectContainer poolableContainer)
 603                        {
 13604                            if (poolableContainer.poolableObject != null)
 605                            {
 1606                                poolableContainer.poolableObject.Release();
 1607                                released = true;
 608                            }
 609                        }
 15610                        if (!released)
 611                        {
 14612                            Utils.SafeDestroy(component.GetTransform()?.gameObject);
 613                        }
 614                        break;
 615                    }
 616            }
 30617        }
 618
 619        public void DisposeAllSceneComponents()
 620        {
 988621            List<string> allDisposableComponents = disposableComponents.Select(x => x.Key).ToList();
 1976622            foreach (string id in allDisposableComponents)
 623            {
 530624                parcelScenesCleaner.MarkDisposableComponentForCleanup(scene, id);
 625            }
 458626        }
 627    }
 628}

Methods/Properties

ECSComponentsManagerLegacy(DCL.Controllers.IParcelScene, DCL.IRuntimeComponentFactory, DCL.IParcelScenesCleaner, DCL.Controllers.ISceneBoundsChecker, DCL.IPhysicsSyncController, DCL.Rendering.ICullingController)
ECSComponentsManagerLegacy(DCL.Controllers.IParcelScene)
AddSharedComponent(DCL.Models.IDCLEntity, System.Type, DCL.Components.ISharedComponent)
RemoveSharedComponent(DCL.Models.IDCLEntity, System.Type, System.Boolean)
TryGetComponent[T](DCL.Models.IDCLEntity)
TryGetBaseComponent(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID_COMPONENT, DCL.Components.IEntityComponent&)
TryGetSharedComponent(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID, DCL.Components.ISharedComponent&)
GetSharedComponent(DCL.Models.IDCLEntity, System.Type)
HasComponent(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID_COMPONENT)
HasSharedComponent(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID)
RemoveComponent(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID_COMPONENT)
AddComponent(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID_COMPONENT, DCL.Components.IEntityComponent)
GetComponent(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID_COMPONENT)
GetComponents()
GetSharedComponents()
GetComponentsDictionary(DCL.Models.IDCLEntity)
GetSharedComponentsDictionary(DCL.Models.IDCLEntity)
GetComponentsCount()
CleanComponents(DCL.Models.IDCLEntity)
HasSceneSharedComponent(System.String)
GetSceneSharedComponent(System.String)
TryGetSceneSharedComponent(System.String, DCL.Components.ISharedComponent&)
GetSceneSharedComponentsDictionary()
GetSceneSharedComponentsCount()
AddSceneSharedComponent(System.String, DCL.Components.ISharedComponent)
RemoveSceneSharedComponent(System.String)
SceneSharedComponentCreate(System.String, System.Int32)
GetSceneSharedComponent[T]()
SceneSharedComponentAttach(System.Int64, System.String)
EntityComponentCreateOrUpdate(System.Int64, DCL.Models.CLASS_ID_COMPONENT, System.Object)
EntityComponentUpdate(DCL.Models.IDCLEntity, DCL.Models.CLASS_ID_COMPONENT, System.String)
SceneSharedComponentDispose(System.String)
SceneSharedComponentUpdate(System.String, BaseModel)
SceneSharedComponentUpdate(System.String, System.String)
EntityComponentRemove(System.Int64, System.String)
DisposeAllSceneComponents()