public void DeleteEntity(DCLBuilderInWorldEntity entityToDelete, bool checkSelection = true) { if (entityToDelete.IsSelected && checkSelection) { DeselectEntity(entityToDelete); } if (selectedEntities.Contains(entityToDelete)) { selectedEntities.Remove(entityToDelete); } string entityName = entityToDelete.GetDescriptiveName(); if (entityNameList.Contains(entityName)) { entityNameList.Remove(entityName); } RemoveConvertedEntity(entityToDelete.rootEntity); entityToDelete.rootEntity.OnRemoved -= RemoveConvertedEntity; entityToDelete.Delete(); string idToRemove = entityToDelete.rootEntity.entityId; Destroy(entityToDelete); if (sceneToEdit.entities.ContainsKey(idToRemove)) { sceneToEdit.RemoveEntity(idToRemove, true); } hudController?.RefreshCatalogAssetPack(); EntityListChanged(); builderInWorldBridge?.RemoveEntityOnKernel(idToRemove, sceneToEdit); }
public void RefreshCatalogAssetPackCorrectly() { // Act buildModeHUDController.RefreshCatalogAssetPack(); // Assert buildModeHUDController.view.Received(1).RefreshCatalogAssetPack(); }
public void DeleteEntity(BIWEntity entityToDelete, bool checkSelection) { if (entityToDelete.IsSelected && checkSelection) { DeselectEntity(entityToDelete); } if (selectedEntities.Contains(entityToDelete)) { selectedEntities.Remove(entityToDelete); hudController?.UpdateEntitiesSelection(selectedEntities.Count); } string entityName = entityToDelete.GetDescriptiveName(); if (entityNameList.Contains(entityName)) { entityNameList.Remove(entityName); } RemoveConvertedEntity(entityToDelete.rootEntity); entityToDelete.rootEntity.OnRemoved -= RemoveConvertedEntity; entityToDelete.Delete(); string idToRemove = entityToDelete.rootEntity.entityId; OnEntityDeleted?.Invoke(entityToDelete); creatorController.RemoveLoadingObjectInmediate(entityToDelete.rootEntity.entityId); if (sceneToEdit.entities.ContainsKey(idToRemove)) { sceneToEdit.RemoveEntity(idToRemove, true); } hudController?.RefreshCatalogAssetPack(); EntityListChanged(); bridge?.RemoveEntityOnKernel(idToRemove, sceneToEdit); }