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 TestRemoveEntityKernelUpdate() { //Arrange DCLBuilderInWorldEntity entity = entityHandler.CreateEmptyEntity(scene, Vector3.zero, Vector3.zero); //Act biwBridge.RemoveEntityOnKernel(entity.rootEntity.entityId, scene); //Assert CheckMessageReceived(); }
public void TestSaveActivate() { //Arrange biwSaveController.ResetSaveTime(); //Act builderInWorldBridge.RemoveEntityOnKernel("test", scene); //Assert Assert.IsFalse(biwSaveController.CanSave()); }
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); }