public void ErrorGameObjectDestruction()
    {
        //Arrange
        BIWCatalogManager.Init();
        BIWTestHelper.CreateTestCatalogLocalSingleObject();
        CatalogItem item = DataStore.i.dataStoreBuilderInWorld.catalogItemDict.GetValues()[0];

        biwCreatorController.CreateCatalogItem(item);
        BIWEntity entity = entityHandler.GetAllEntitiesFromCurrentScene().FirstOrDefault();

        biwCreatorController.CreateErrorOnEntity(entity);

        //Act
        biwCreatorController.DeleteErrorOnEntity(entity);

        //Assert
        Assert.IsFalse(biwCreatorController.IsAnyErrorOnEntities());
    }
Ejemplo n.º 2
0
    public void CreateFloor()
    {
        //Arrange
        BIWCatalogManager.Init();
        BuilderInWorldTestHelper.CreateTestCatalogLocalMultipleFloorObjects();
        CatalogItem floorItem = DataStore.i.builderInWorld.catalogItemDict.GetValues()[0];

        controller.InitGameObjects();
        controller.FindSceneToEdit();
        controller.InitControllers();

        biwCreatorController.EnterEditMode(scene);
        biwFloorHandler.EnterEditMode(scene);

        //Act
        biwFloorHandler.CreateFloor(floorItem);

        //Assert
        foreach (DCLBuilderInWorldEntity entity in entityHandler.GetAllEntitiesFromCurrentScene())
        {
            if (entity.isFloor)
            {
                Assert.IsTrue(biwFloorHandler.ExistsFloorPlaceHolderForEntity(entity.rootEntity.entityId));
                Assert.AreEqual(entity.GetCatalogItemAssociated().id, floorItem.id);
                break;
            }
        }

        foreach (DCLBuilderInWorldEntity entity in entityHandler.GetAllEntitiesFromCurrentScene())
        {
            if (entity.isFloor)
            {
                if (!entity.rootEntity.TryGetSharedComponent(CLASS_ID.GLTF_SHAPE, out ISharedComponent component))
                {
                    Assert.Fail("Floor doesn't contains a GLTFShape!");
                }

                entity.rootEntity.OnShapeUpdated?.Invoke(entity.rootEntity);
                Assert.IsFalse(biwFloorHandler.ExistsFloorPlaceHolderForEntity(entity.rootEntity.entityId));
                break;
            }
        }
    }
Ejemplo n.º 3
0
    public void ShowCategories()
    {
        currentSection = BuildModeCatalogSection.CATEGORIES;
        biwSearchBarController.ReleaseFilters();

        if (sceneCatalogView.catalogAssetPackList != null)
        {
            sceneCatalogView.catalogAssetPackList.SetCategoryStyle();
            sceneCatalogView.catalogAssetPackList.SetContent(BIWCatalogManager.GetCatalogItemPacksFilteredByCategories());
            sceneCatalogView.catalogAssetPackList.gameObject.SetActive(true);
        }

        isShowingAssetPacks = true;
        sceneCatalogView.SetCatalogTitle(BIWSettings.CATALOG_ASSET_PACK_TITLE);

        if (sceneCatalogView.catalogGroupList != null)
        {
            sceneCatalogView.catalogGroupList.gameObject.SetActive(false);
        }

        sceneCatalogView.ShowBackButton(false);
    }
Ejemplo n.º 4
0
    public void ShowAssetsPacks()
    {
        currentSection = BuildModeCatalogSection.ASSET_PACKS;
        biwSearchBarController.ReleaseFilters();

        if (sceneCatalogView.catalogAssetPackList != null)
        {
            sceneCatalogView.catalogAssetPackList.SetAssetPackStyle();
            sceneCatalogView.catalogAssetPackList.SetContent(BIWCatalogManager.GetCatalogItemPackList());
            sceneCatalogView.catalogAssetPackList.gameObject.SetActive(true);
        }
        isShowingAssetPacks = true;
        sceneCatalogView.SetCatalogTitle(BuilderInWorldSettings.CATALOG_ASSET_PACK_TITLE);
        RefreshCatalog();

        if (sceneCatalogView.catalogGroupList != null)
        {
            sceneCatalogView.catalogGroupList.gameObject.SetActive(false);
        }

        sceneCatalogView.ShowBackButton(false);
    }
Ejemplo n.º 5
0
    public void CreateLastItem()
    {
        //Arrange
        BIWCatalogManager.Init();
        BuilderInWorldTestHelper.CreateTestCatalogLocalSingleObject();
        CatalogItem item = DataStore.i.builderInWorld.catalogItemDict.GetValues()[0];

        //Act
        biwCreatorController.CreateCatalogItem(item);
        biwCreatorController.CreateLastCatalogItem();

        //Assert
        int cont = 0;

        foreach (DCLBuilderInWorldEntity entity in entityHandler.GetAllEntitiesFromCurrentScene())
        {
            if (entity.GetCatalogItemAssociated().id == item.id)
            {
                cont++;
            }
        }
        Assert.AreEqual(cont, 2);
    }
Ejemplo n.º 6
0
 protected override IEnumerator TearDown()
 {
     AssetCatalogBridge.i.ClearCatalog();
     BIWCatalogManager.ClearCatalog();
     yield return(base.TearDown());
 }
 public void RefreshCatalog()
 {
     catalogAssetPackListView.SetContent(BIWCatalogManager.GetCatalogItemPackList());
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     BIWCatalogManager.Init();
 }