private void updateTextures() { //On récupère le texture pack selectionné: TexturePack selectedTexturePack = textureDictionary[selectedTexture]; //On affiche le nom du pack texture selectionné dans l'UI: textureNameUI.text = selectedTexturePack.getTextureName(); //On affiche la preview des prefabs du texture pack selectionné: Sprite floorSprite = getAssetFromGameObject(selectedTexturePack.getFloorPrefab()); Sprite destructibleWallSprite = getAssetFromGameObject(selectedTexturePack.getDestructibleWallPrefab()); Sprite indestructibleWallSprite = getAssetFromGameObject(selectedTexturePack.getIndestructibleWallPrefab()); if (floorSprite != null) { textureFloorPreviewUI.sprite = floorSprite; } if (destructibleWallSprite != null) { textureDestructibleWallPreviewUI.sprite = destructibleWallSprite; } if (indestructibleWallSprite != null) { textureIndestructibleWallPreviewUI.sprite = indestructibleWallSprite; } }
private void instanciateTextures(TexturePack texture) { //Instanciate all textures from the choosen texture pack: floor = texture.getFloorPrefab(); destructibleWall = texture.getDestructibleWallPrefab(); indestructibleWall = texture.getIndestructibleWallPrefab(); }