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()); }
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; } } }
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); }
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); }
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); }
protected override IEnumerator TearDown() { AssetCatalogBridge.i.ClearCatalog(); BIWCatalogManager.ClearCatalog(); yield return(base.TearDown()); }
public void RefreshCatalog() { catalogAssetPackListView.SetContent(BIWCatalogManager.GetCatalogItemPackList()); }
private void Awake() { BIWCatalogManager.Init(); }