コード例 #1
0
    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);
    }
コード例 #2
0
    public void TestRemoveEntityKernelUpdate()
    {
        //Arrange
        DCLBuilderInWorldEntity entity = entityHandler.CreateEmptyEntity(scene, Vector3.zero, Vector3.zero);

        //Act
        biwBridge.RemoveEntityOnKernel(entity.rootEntity.entityId, scene);

        //Assert
        CheckMessageReceived();
    }
コード例 #3
0
    public void TestSaveActivate()
    {
        //Arrange
        biwSaveController.ResetSaveTime();

        //Act
        builderInWorldBridge.RemoveEntityOnKernel("test", scene);

        //Assert
        Assert.IsFalse(biwSaveController.CanSave());
    }
コード例 #4
0
    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);
    }