578d3890d919ba81bbcafe4b82d9b217f85053b9..2dfa4588b3b5bba2a84dab239d62b1c285478870
2025-04-02 miepzerino
inventory scrollbar autohide
2dfa45 diff | tree
2025-04-02 miepzerino
#39 added fog of war
58cfba diff | tree
6 files modified
18 files added
1011 ■■■■■ changed files
Assets/Scenes/GameplayScene.unity 173 ●●●●● patch | view | raw | blame | history
Assets/Scripts/FogOfWar.cs 203 ●●●●● patch | view | raw | blame | history
Assets/Scripts/FogOfWar.cs.meta 11 ●●●●● patch | view | raw | blame | history
Assets/Scripts/Managers/GameManager.cs 3 ●●●●● patch | view | raw | blame | history
Assets/Scripts/Saving/SaveData.cs 18 ●●●●● patch | view | raw | blame | history
Assets/Scripts/Saving/SaveSystem.cs 1 ●●●● patch | view | raw | blame | history
Assets/Scripts/UI/PauseMenu.cs 2 ●●● patch | view | raw | blame | history
Assets/TileSets/Fog.meta 8 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Fog/FogOfWar.png patch | view | raw | blame | history
Assets/TileSets/Fog/FogOfWar.png.meta 127 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset.meta 8 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar100.asset 36 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar100.asset.meta 8 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar20.asset 36 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar20.asset.meta 8 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar40.asset 36 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar40.asset.meta 8 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar60.asset 36 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar60.asset.meta 8 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar80.asset 36 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar80.asset.meta 8 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/FogPalette.prefab 216 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/FogPalette.prefab.meta 7 ●●●●● patch | view | raw | blame | history
Assets/TileSets/Palettes/ForestTileset.prefab 14 ●●●●● patch | view | raw | blame | history
Assets/Scenes/GameplayScene.unity
@@ -1586,6 +1586,7 @@
  m_LocalScale: {x: 1, y: 1, z: 1}
  m_ConstrainProportionsScale: 0
  m_Children:
  - {fileID: 1794216240}
  - {fileID: 1919262557}
  - {fileID: 1235149191}
  m_Father: {fileID: 0}
@@ -1945,7 +1946,7 @@
  m_HorizontalScrollbar: {fileID: 0}
  m_VerticalScrollbar: {fileID: 1826729471}
  m_HorizontalScrollbarVisibility: 2
  m_VerticalScrollbarVisibility: 0
  m_VerticalScrollbarVisibility: 1
  m_HorizontalScrollbarSpacing: -3
  m_VerticalScrollbarSpacing: -3
  m_OnValueChanged:
@@ -4520,6 +4521,131 @@
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 1725312356}
  m_CullTransparentMesh: 1
--- !u!1 &1776306376 stripped
GameObject:
  m_CorrespondingSourceObject: {fileID: 8598998496262044661, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
  m_PrefabInstance: {fileID: 75655679957548990}
  m_PrefabAsset: {fileID: 0}
--- !u!1 &1794216239
GameObject:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  serializedVersion: 6
  m_Component:
  - component: {fileID: 1794216240}
  - component: {fileID: 1794216242}
  - component: {fileID: 1794216241}
  m_Layer: 6
  m_Name: FogTilemap
  m_TagString: Untagged
  m_Icon: {fileID: 0}
  m_NavMeshLayer: 0
  m_StaticEditorFlags: 0
  m_IsActive: 1
--- !u!4 &1794216240
Transform:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 1794216239}
  serializedVersion: 2
  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
  m_LocalPosition: {x: 0, y: 0, z: 0}
  m_LocalScale: {x: 1, y: 1, z: 1}
  m_ConstrainProportionsScale: 0
  m_Children: []
  m_Father: {fileID: 727795133}
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!483693784 &1794216241
TilemapRenderer:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 1794216239}
  m_Enabled: 1
  m_CastShadows: 0
  m_ReceiveShadows: 0
  m_DynamicOccludee: 1
  m_StaticShadowCaster: 0
  m_MotionVectors: 1
  m_LightProbeUsage: 0
  m_ReflectionProbeUsage: 0
  m_RayTracingMode: 0
  m_RayTraceProcedural: 0
  m_RenderingLayerMask: 1
  m_RendererPriority: 0
  m_Materials:
  - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
  m_StaticBatchInfo:
    firstSubMesh: 0
    subMeshCount: 0
  m_StaticBatchRoot: {fileID: 0}
  m_ProbeAnchor: {fileID: 0}
  m_LightProbeVolumeOverride: {fileID: 0}
  m_ScaleInLightmap: 1
  m_ReceiveGI: 1
  m_PreserveUVs: 0
  m_IgnoreNormalsForChartDetection: 0
  m_ImportantGI: 0
  m_StitchLightmapSeams: 1
  m_SelectedEditorRenderState: 0
  m_MinimumChartSize: 4
  m_AutoUVMaxDistance: 0.5
  m_AutoUVMaxAngle: 89
  m_LightmapParameters: {fileID: 0}
  m_SortingLayerID: 1721078169
  m_SortingLayer: -1
  m_SortingOrder: 1
  m_ChunkSize: {x: 32, y: 32, z: 32}
  m_ChunkCullingBounds: {x: 0, y: 0, z: 0}
  m_MaxChunkCount: 16
  m_MaxFrameAge: 16
  m_SortOrder: 0
  m_Mode: 0
  m_DetectChunkCullingBounds: 0
  m_MaskInteraction: 0
--- !u!1839735485 &1794216242
Tilemap:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 1794216239}
  m_Enabled: 1
  m_Tiles: {}
  m_AnimatedTiles: {}
  m_TileAssetArray: []
  m_TileSpriteArray: []
  m_TileMatrixArray: []
  m_TileColorArray: []
  m_TileObjectToInstantiateArray: []
  m_AnimationFrameRate: 1
  m_Color: {r: 1, g: 1, b: 1, a: 1}
  m_Origin: {x: 0, y: 0, z: 0}
  m_Size: {x: 0, y: 0, z: 1}
  m_TileAnchor: {x: 0.5, y: 0.5, z: 0}
  m_TileOrientation: 0
  m_TileOrientationMatrix:
    e00: 1
    e01: 0
    e02: 0
    e03: 0
    e10: 0
    e11: 1
    e12: 0
    e13: 0
    e20: 0
    e21: 0
    e22: 1
    e23: 0
    e30: 0
    e31: 0
    e32: 0
    e33: 1
--- !u!1 &1826729469
GameObject:
  m_ObjectHideFlags: 0
@@ -5366,9 +5492,17 @@
      value: 
      objectReference: {fileID: 1919262559}
    - target: {fileID: 6908574976455911116, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
      propertyPath: fogOfWar
      value:
      objectReference: {fileID: 75655679957548994}
    - target: {fileID: 6908574976455911116, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
      propertyPath: playerUI
      value: 
      objectReference: {fileID: 90387968388784992}
    - target: {fileID: 6908574976455911116, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
      propertyPath: fogTilemap
      value:
      objectReference: {fileID: 1794216242}
    - target: {fileID: 6908574976455911116, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
      propertyPath: gameCanvas
      value: 
@@ -5448,19 +5582,50 @@
    m_RemovedComponents: []
    m_RemovedGameObjects: []
    m_AddedGameObjects: []
    m_AddedComponents: []
    m_AddedComponents:
    - targetCorrespondingSourceObject: {fileID: 8598998496262044661, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
      insertIndex: -1
      addedObject: {fileID: 75655679957548994}
  m_SourcePrefab: {fileID: 100100000, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
--- !u!114 &75655679957548991 stripped
MonoBehaviour:
  m_CorrespondingSourceObject: {fileID: 6908574976455911116, guid: 7296d9a2424531f4ba42c0c75e9c48a0, type: 3}
  m_PrefabInstance: {fileID: 75655679957548990}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_GameObject: {fileID: 1776306376}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 11500000, guid: ee189283a861cae42b728253b8229316, type: 3}
  m_Name: 
  m_EditorClassIdentifier: 
--- !u!114 &75655679957548994
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 1776306376}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 11500000, guid: e98672417f6c56e4d8020c2453ced645, type: 3}
  m_Name:
  m_EditorClassIdentifier:
  fogTilemap: {fileID: 1794216242}
  fogTile: {fileID: 11400000, guid: 54e9042346ddcc347aa31573844df14b, type: 2}
  player: {fileID: 254538002}
  viewRadius: 5
  mainCamera: {fileID: 519420031}
  fogLevels:
  - tile: {fileID: 11400000, guid: ee11684c9f570a741917f425e4ff9bf1, type: 2}
    opacity: 20
  - tile: {fileID: 11400000, guid: cfdca8d69259ece46ac1c967fcfcc447, type: 2}
    opacity: 40
  - tile: {fileID: 11400000, guid: e70bfd59f79cdce449d7a6a67b4a1722, type: 2}
    opacity: 60
  - tile: {fileID: 11400000, guid: 546f1dbae64d6ce49b8474fc131c86b9, type: 2}
    opacity: 80
  - tile: {fileID: 11400000, guid: 54e9042346ddcc347aa31573844df14b, type: 2}
    opacity: 100
--- !u!223 &90387968388784992
Canvas:
  m_ObjectHideFlags: 0
@@ -6562,7 +6727,7 @@
  m_HorizontalScrollbar: {fileID: 0}
  m_VerticalScrollbar: {fileID: 9023304646215873866}
  m_HorizontalScrollbarVisibility: 2
  m_VerticalScrollbarVisibility: 0
  m_VerticalScrollbarVisibility: 1
  m_HorizontalScrollbarSpacing: -3
  m_VerticalScrollbarSpacing: -3
  m_OnValueChanged:
Assets/Scripts/FogOfWar.cs
New file
@@ -0,0 +1,203 @@
using UnityEngine;
using UnityEngine.Tilemaps;
public class FogOfWar : MonoBehaviour
{
    public Tilemap fogTilemap;
    public TileBase fogTile;
    public Transform player;
    public int viewRadius = 5;
    public Camera mainCamera;
    private Vector3Int lastPlayerCell;
    private const float UpdateInterval = 0.1f; // Update every 100ms
    private float updateTimer;
    private TileBase[,] discoveredFog; // Store the lowest opacity fog level for each tile
    [System.Serializable]
    public class FogLevel
    {
        public TileBase tile;
        public float opacity;
    }
    public FogLevel[] fogLevels;
    private void Start()
    {
        if (mainCamera == null)
            mainCamera = Camera.main;
        // Initialize the discovered fog array
        int fogDepth = GenerateTileMap.groundDepth - 1; // Subtract 2 to account for array starting at y=-3
        discoveredFog = new TileBase[GenerateTileMap.maxWidth + 1, fogDepth];
        // Initialize fog using GenerateTileMap bounds
        for (int x = 0; x <= GenerateTileMap.maxWidth; x++)
        {
            // Clear surface tiles (0 to -1)
            for (int y = 0; y >= -1; y--)
            {
                Vector3Int tilePosition = new Vector3Int(x, y, 0);
                fogTilemap.SetTile(tilePosition, null);
            }
            // Set fog for underground tiles (-2 and below)
            for (int y = -2; y >= -GenerateTileMap.groundDepth; y--)
            {
                Vector3Int tilePosition = new Vector3Int(x, y, 0);
                fogTilemap.SetTile(tilePosition, fogTile);
                // Convert to array index (y=-2 maps to array index 0)
                int arrayY = Mathf.Abs(y + 2);
                discoveredFog[x, arrayY] = fogTile;
            }
        }
        // Position the fog tilemap at the same position as the main tilemap
        fogTilemap.transform.position = new Vector3(
            (GenerateTileMap.maxWidth / 2) * -1,
            -1,
            transform.position.z
        );
        lastPlayerCell = fogTilemap.WorldToCell(player.position);
        if (SaveSystem.isGameLoaded)
        {
            SaveDataMap mapState = SaveSystem.LoadMapState();
            if (mapState != null && mapState.fogOfWarData != null)
            {
                GetComponent<FogOfWar>().LoadFromSaveData(mapState.fogOfWarData);
            }
        }
    }
    private void Update()
    {
        updateTimer += Time.deltaTime;
        if (updateTimer < UpdateInterval)
            return;
        updateTimer = 0;
        Vector3Int playerCell = fogTilemap.WorldToCell(player.position);
        // Only update if player moved to a new cell
        if (playerCell == lastPlayerCell)
            return;
        lastPlayerCell = playerCell;
        // Get camera bounds in world space
        Vector2 cameraMin = mainCamera.ViewportToWorldPoint(new Vector3(0, 0));
        Vector2 cameraMax = mainCamera.ViewportToWorldPoint(new Vector3(1, 1));
        // Convert to tile coordinates
        Vector3Int tileMin = fogTilemap.WorldToCell(cameraMin);
        Vector3Int tileMax = fogTilemap.WorldToCell(cameraMax);
        // Clamp to map bounds
        tileMin.x = Mathf.Max(0, tileMin.x - viewRadius);
        tileMin.y = Mathf.Max(-GenerateTileMap.groundDepth, tileMin.y - viewRadius);
        tileMax.x = Mathf.Min(GenerateTileMap.maxWidth, tileMax.x + viewRadius);
        tileMax.y = Mathf.Min(-2, tileMax.y + viewRadius);
        // Clear fog around player
        // Only check tiles within camera view
        for (int x = tileMin.x; x <= tileMax.x; x++)
        {
            for (int y = tileMin.y; y <= tileMax.y; y++)
            {
                Vector3Int tilePosition = new Vector3Int(x, y, 0);
                float distance = Vector2.Distance(((Vector2Int)playerCell), (Vector2Int)tilePosition);
                if (distance <= viewRadius)
                {
                    int fogIndex = Mathf.FloorToInt((distance / viewRadius) * (fogLevels.Length - 1));
                    fogIndex = Mathf.Clamp(fogIndex, 0, fogLevels.Length - 1);
                    TileBase newFogTile = distance <= 1 ? null : fogLevels[fogIndex].tile;
                    // Update the discovered state with the lowest opacity (null or lower fog index)
                    int arrayY = Mathf.Abs(y + 2); // y=-2 maps to array index 0
                    if (x >= 0 && x < discoveredFog.GetLength(0) &&
                        arrayY >= 0 && arrayY < discoveredFog.GetLength(1))
                    {
                        if (newFogTile == null)
                        {
                            discoveredFog[x, arrayY] = null;
                        }
                        else if (discoveredFog[x, arrayY] != null)
                        {
                            // Find the index of the current and new fog tiles
                            int currentIndex = System.Array.FindIndex(fogLevels, f => f.tile == discoveredFog[x, arrayY]);
                            int newIndex = System.Array.FindIndex(fogLevels, f => f.tile == newFogTile);
                            // Keep the lower opacity version
                            if (newIndex < currentIndex)
                            {
                                discoveredFog[x, arrayY] = newFogTile;
                            }
                        }
                        // Always use the discovered state
                        fogTilemap.SetTile(tilePosition, discoveredFog[x, arrayY]);
                    }
                }
            }
        }
    }
    public FogOfWarData GetSaveData()
    {
        FogOfWarData saveData = new FogOfWarData();
        for (int x = 0; x < discoveredFog.GetLength(0); x++)
        {
            for (int y = 0; y < discoveredFog.GetLength(1); y++)
            {
                TileBase currentTile = discoveredFog[x, y];
                if (currentTile == null || currentTile != fogTile) // Only save revealed tiles
                {
                    FogTileData tileData = new FogTileData
                    {
                        x = x,
                        y = y,
                        fogLevelIndex = currentTile == null ? -1 : System.Array.FindIndex(fogLevels, f => f.tile == currentTile)
                    };
                    saveData.discoveredTiles.Add(tileData);
                }
            }
        }
        return saveData;
    }
    public void LoadFromSaveData(FogOfWarData saveData)
    {
        if (saveData == null || saveData.discoveredTiles == null)
            return;
        // Reset fog to full opacity
        for (int x = 0; x < discoveredFog.GetLength(0); x++)
        {
            // Reset underground tiles only (-2 and below)
            for (int y = -2; y >= -GenerateTileMap.groundDepth; y--)
            {
                Vector3Int tilePosition = new Vector3Int(x, y, 0);
                fogTilemap.SetTile(tilePosition, fogTile);
                int arrayY = Mathf.Abs(y + 2);
                discoveredFog[x, arrayY] = fogTile;
            }
        }
        // Apply saved fog states
        foreach (FogTileData tileData in saveData.discoveredTiles)
        {
            if (tileData.x >= 0 && tileData.x < discoveredFog.GetLength(0) &&
                tileData.y >= 0 && tileData.y < discoveredFog.GetLength(1))
            {
                TileBase tileToUse = tileData.fogLevelIndex == -1 ? null : fogLevels[tileData.fogLevelIndex].tile;
                discoveredFog[tileData.x, tileData.y] = tileToUse;
                // Convert array Y coordinate back to world Y coordinate
                int worldY = -(tileData.y + 2); // Convert array index back to world coordinates
                fogTilemap.SetTile(new Vector3Int(tileData.x, worldY, 0), tileToUse);
            }
        }
    }
}
Assets/Scripts/FogOfWar.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e98672417f6c56e4d8020c2453ced645
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/Scripts/Managers/GameManager.cs
@@ -25,6 +25,8 @@
    [NonSerialized]
    public List<Vector3Int> destroyedTiles = new List<Vector3Int>();
    public GameObject pickups;
    public Tilemap fogTilemap;
    public FogOfWar fogOfWar;
    private void Awake()
    {
@@ -52,6 +54,7 @@
        SaveDataMap mapState = SaveSystem.LoadMapState();
        if (mapState != null)
        {
            //fogOfWar.LoadFromSaveData(mapState.fogOfWarData);
            generateTileMap.SetSettingsFromSeed(mapState.seed);
            if (mapState.destroyedTiles != null && mapState.destroyedTiles.Count > 0)
            {
Assets/Scripts/Saving/SaveData.cs
@@ -51,10 +51,12 @@
{
    public int seed;
    public List<DestroyedTile> destroyedTiles;
    public SaveDataMap(List<Vector3Int> destroyedTiles, int seed)
    public FogOfWarData fogOfWarData;
    public SaveDataMap(List<Vector3Int> destroyedTiles, int seed, FogOfWarData fogOfWarData)
    {
        this.seed = seed;
        this.destroyedTiles = new List<DestroyedTile>();
        this.fogOfWarData = fogOfWarData;
        foreach (var item in destroyedTiles.ConvertToListIntArray())
        {
            this.destroyedTiles.Add(new DestroyedTile(item));
@@ -71,4 +73,18 @@
    }
    public int[] tileCoord;
}
[System.Serializable]
public class FogTileData
{
    public int x;
    public int y;
    public int fogLevelIndex; // -1 for no fog, 0+ for fog level index
}
[System.Serializable]
public class FogOfWarData
{
    public List<FogTileData> discoveredTiles = new List<FogTileData>();
}
#endregion
Assets/Scripts/Saving/SaveSystem.cs
@@ -1,6 +1,7 @@
using UnityEngine;
using System.IO;
using System.Runtime.Serialization.Json;
using UnityEngine.Tilemaps;
public static class SaveSystem
{
Assets/Scripts/UI/PauseMenu.cs
@@ -65,7 +65,7 @@
        Inventory playerInventory = GameObject.Find("Player").GetComponent<Inventory>();
        SaveSystem.SavePlayer(new SaveDataPlayer(playerController, playerInventory));
        GameManager gameManager= GameObject.Find("GameManager").GetComponent<GameManager>();
        SaveSystem.SaveMapState(new SaveDataMap(gameManager.destroyedTiles, gameManager.generateTileMap.seed.Value));
        SaveSystem.SaveMapState(new SaveDataMap(gameManager.destroyedTiles, gameManager.generateTileMap.seed.Value, gameManager.GetComponent<FogOfWar>().GetSaveData()));
        animator.SetTrigger("GameSaved");
    }
Assets/TileSets/Fog.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3938825b068808345840f92ae5a31e32
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Fog/FogOfWar.png
Assets/TileSets/Fog/FogOfWar.png.meta
New file
@@ -0,0 +1,127 @@
fileFormatVersion: 2
guid: a3911f1006248b841aa87e328f267fcf
TextureImporter:
  internalIDToNameTable: []
  externalObjects: {}
  serializedVersion: 12
  mipmaps:
    mipMapMode: 0
    enableMipMap: 0
    sRGBTexture: 1
    linearTexture: 0
    fadeOut: 0
    borderMipMap: 0
    mipMapsPreserveCoverage: 0
    alphaTestReferenceValue: 0.5
    mipMapFadeDistanceStart: 1
    mipMapFadeDistanceEnd: 3
  bumpmap:
    convertToNormalMap: 0
    externalNormalMap: 0
    heightScale: 0.25
    normalMapFilter: 0
    flipGreenChannel: 0
  isReadable: 0
  streamingMipmaps: 0
  streamingMipmapsPriority: 0
  vTOnly: 0
  ignoreMipmapLimit: 0
  grayScaleToAlpha: 0
  generateCubemap: 6
  cubemapConvolution: 0
  seamlessCubemap: 0
  textureFormat: 1
  maxTextureSize: 2048
  textureSettings:
    serializedVersion: 2
    filterMode: 0
    aniso: 1
    mipBias: 0
    wrapU: 1
    wrapV: 1
    wrapW: 1
  nPOTScale: 0
  lightmap: 0
  compressionQuality: 50
  spriteMode: 1
  spriteExtrude: 1
  spriteMeshType: 1
  alignment: 0
  spritePivot: {x: 0.5, y: 0.5}
  spritePixelsToUnits: 16
  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
  spriteGenerateFallbackPhysicsShape: 1
  alphaUsage: 1
  alphaIsTransparency: 1
  spriteTessellationDetail: -1
  textureType: 8
  textureShape: 1
  singleChannelComponent: 0
  flipbookRows: 1
  flipbookColumns: 1
  maxTextureSizeSet: 0
  compressionQualitySet: 0
  textureFormatSet: 0
  ignorePngGamma: 0
  applyGammaDecoding: 0
  swizzle: 50462976
  cookieLightType: 0
  platformSettings:
  - serializedVersion: 3
    buildTarget: DefaultTexturePlatform
    maxTextureSize: 4096
    resizeAlgorithm: 0
    textureFormat: -1
    textureCompression: 0
    compressionQuality: 50
    crunchedCompression: 0
    allowsAlphaSplitting: 0
    overridden: 0
    ignorePlatformSupport: 0
    androidETC2FallbackOverride: 0
    forceMaximumCompressionQuality_BC6H_BC7: 0
  - serializedVersion: 3
    buildTarget: Standalone
    maxTextureSize: 2048
    resizeAlgorithm: 0
    textureFormat: -1
    textureCompression: 1
    compressionQuality: 50
    crunchedCompression: 0
    allowsAlphaSplitting: 0
    overridden: 0
    ignorePlatformSupport: 0
    androidETC2FallbackOverride: 0
    forceMaximumCompressionQuality_BC6H_BC7: 0
  - serializedVersion: 3
    buildTarget: Server
    maxTextureSize: 2048
    resizeAlgorithm: 0
    textureFormat: -1
    textureCompression: 1
    compressionQuality: 50
    crunchedCompression: 0
    allowsAlphaSplitting: 0
    overridden: 0
    ignorePlatformSupport: 0
    androidETC2FallbackOverride: 0
    forceMaximumCompressionQuality_BC6H_BC7: 0
  spriteSheet:
    serializedVersion: 2
    sprites: []
    outline: []
    physicsShape: []
    bones: []
    spriteID: 5e97eb03825dee720800000000000000
    internalID: 0
    vertices: []
    indices:
    edges: []
    weights: []
    secondaryTextures: []
    nameFileIdTable: {}
  mipmapLimitGroupName:
  pSDRemoveMatte: 0
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/Files/FogTileset.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 97d90ba9a2a5cf7429f72929dd4eb41b
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar100.asset
New file
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
  m_Name: FogOfWar100
  m_EditorClassIdentifier:
  m_Sprite: {fileID: 21300000, guid: a3911f1006248b841aa87e328f267fcf, type: 3}
  m_Color: {r: 1, g: 1, b: 1, a: 1}
  m_Transform:
    e00: 1
    e01: 0
    e02: 0
    e03: 0
    e10: 0
    e11: 1
    e12: 0
    e13: 0
    e20: 0
    e21: 0
    e22: 1
    e23: 0
    e30: 0
    e31: 0
    e32: 0
    e33: 1
  m_InstancedGameObject: {fileID: 0}
  m_Flags: 1
  m_ColliderType: 1
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar100.asset.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 54e9042346ddcc347aa31573844df14b
NativeFormatImporter:
  externalObjects: {}
  mainObjectFileID: 11400000
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar20.asset
New file
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
  m_Name: FogOfWar20
  m_EditorClassIdentifier:
  m_Sprite: {fileID: 21300000, guid: a3911f1006248b841aa87e328f267fcf, type: 3}
  m_Color: {r: 1, g: 1, b: 1, a: 0.2}
  m_Transform:
    e00: 1
    e01: 0
    e02: 0
    e03: 0
    e10: 0
    e11: 1
    e12: 0
    e13: 0
    e20: 0
    e21: 0
    e22: 1
    e23: 0
    e30: 0
    e31: 0
    e32: 0
    e33: 1
  m_InstancedGameObject: {fileID: 0}
  m_Flags: 1
  m_ColliderType: 1
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar20.asset.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ee11684c9f570a741917f425e4ff9bf1
NativeFormatImporter:
  externalObjects: {}
  mainObjectFileID: 11400000
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar40.asset
New file
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
  m_Name: FogOfWar40
  m_EditorClassIdentifier:
  m_Sprite: {fileID: 21300000, guid: a3911f1006248b841aa87e328f267fcf, type: 3}
  m_Color: {r: 1, g: 1, b: 1, a: 0.4}
  m_Transform:
    e00: 1
    e01: 0
    e02: 0
    e03: 0
    e10: 0
    e11: 1
    e12: 0
    e13: 0
    e20: 0
    e21: 0
    e22: 1
    e23: 0
    e30: 0
    e31: 0
    e32: 0
    e33: 1
  m_InstancedGameObject: {fileID: 0}
  m_Flags: 1
  m_ColliderType: 1
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar40.asset.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cfdca8d69259ece46ac1c967fcfcc447
NativeFormatImporter:
  externalObjects: {}
  mainObjectFileID: 11400000
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar60.asset
New file
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
  m_Name: FogOfWar60
  m_EditorClassIdentifier:
  m_Sprite: {fileID: 21300000, guid: a3911f1006248b841aa87e328f267fcf, type: 3}
  m_Color: {r: 1, g: 1, b: 1, a: 0.6}
  m_Transform:
    e00: 1
    e01: 0
    e02: 0
    e03: 0
    e10: 0
    e11: 1
    e12: 0
    e13: 0
    e20: 0
    e21: 0
    e22: 1
    e23: 0
    e30: 0
    e31: 0
    e32: 0
    e33: 1
  m_InstancedGameObject: {fileID: 0}
  m_Flags: 1
  m_ColliderType: 1
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar60.asset.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e70bfd59f79cdce449d7a6a67b4a1722
NativeFormatImporter:
  externalObjects: {}
  mainObjectFileID: 11400000
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar80.asset
New file
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
  m_Name: FogOfWar80
  m_EditorClassIdentifier:
  m_Sprite: {fileID: 21300000, guid: a3911f1006248b841aa87e328f267fcf, type: 3}
  m_Color: {r: 1, g: 1, b: 1, a: 0.8}
  m_Transform:
    e00: 1
    e01: 0
    e02: 0
    e03: 0
    e10: 0
    e11: 1
    e12: 0
    e13: 0
    e20: 0
    e21: 0
    e22: 1
    e23: 0
    e30: 0
    e31: 0
    e32: 0
    e33: 1
  m_InstancedGameObject: {fileID: 0}
  m_Flags: 1
  m_ColliderType: 1
Assets/TileSets/Palettes/Files/FogTileset/FogOfWar80.asset.meta
New file
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 546f1dbae64d6ce49b8474fc131c86b9
NativeFormatImporter:
  externalObjects: {}
  mainObjectFileID: 11400000
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/FogPalette.prefab
New file
@@ -0,0 +1,216 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6062001073513239874
GameObject:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  serializedVersion: 6
  m_Component:
  - component: {fileID: 4892262843372918448}
  - component: {fileID: 8001729803293336442}
  - component: {fileID: 1444793158423354334}
  m_Layer: 0
  m_Name: Layer1
  m_TagString: Untagged
  m_Icon: {fileID: 0}
  m_NavMeshLayer: 0
  m_StaticEditorFlags: 0
  m_IsActive: 1
--- !u!4 &4892262843372918448
Transform:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 6062001073513239874}
  serializedVersion: 2
  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
  m_LocalPosition: {x: 0, y: 0, z: 0}
  m_LocalScale: {x: 1, y: 1, z: 1}
  m_ConstrainProportionsScale: 0
  m_Children: []
  m_Father: {fileID: 7503721036071197686}
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1839735485 &8001729803293336442
Tilemap:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 6062001073513239874}
  m_Enabled: 1
  m_Tiles:
  - first: {x: -3, y: 1, z: 0}
    second:
      serializedVersion: 2
      m_TileIndex: 0
      m_TileSpriteIndex: 0
      m_TileMatrixIndex: 0
      m_TileColorIndex: 0
      m_TileObjectToInstantiateIndex: 65535
      dummyAlignment: 0
      m_AllTileFlags: 1073741825
  m_AnimatedTiles: {}
  m_TileAssetArray:
  - m_RefCount: 1
    m_Data: {fileID: 11400000, guid: 54e9042346ddcc347aa31573844df14b, type: 2}
  m_TileSpriteArray:
  - m_RefCount: 1
    m_Data: {fileID: 21300000, guid: a3911f1006248b841aa87e328f267fcf, type: 3}
  m_TileMatrixArray:
  - m_RefCount: 1
    m_Data:
      e00: 1
      e01: 0
      e02: 0
      e03: 0
      e10: 0
      e11: 1
      e12: 0
      e13: 0
      e20: 0
      e21: 0
      e22: 1
      e23: 0
      e30: 0
      e31: 0
      e32: 0
      e33: 1
  m_TileColorArray:
  - m_RefCount: 1
    m_Data: {r: 1, g: 1, b: 1, a: 1}
  m_TileObjectToInstantiateArray: []
  m_AnimationFrameRate: 1
  m_Color: {r: 1, g: 1, b: 1, a: 1}
  m_Origin: {x: -3, y: 0, z: 0}
  m_Size: {x: 3, y: 2, z: 1}
  m_TileAnchor: {x: 0.5, y: 0.5, z: 0}
  m_TileOrientation: 0
  m_TileOrientationMatrix:
    e00: 1
    e01: 0
    e02: 0
    e03: 0
    e10: 0
    e11: 1
    e12: 0
    e13: 0
    e20: 0
    e21: 0
    e22: 1
    e23: 0
    e30: 0
    e31: 0
    e32: 0
    e33: 1
--- !u!483693784 &1444793158423354334
TilemapRenderer:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 6062001073513239874}
  m_Enabled: 1
  m_CastShadows: 0
  m_ReceiveShadows: 0
  m_DynamicOccludee: 0
  m_StaticShadowCaster: 0
  m_MotionVectors: 1
  m_LightProbeUsage: 0
  m_ReflectionProbeUsage: 0
  m_RayTracingMode: 0
  m_RayTraceProcedural: 0
  m_RenderingLayerMask: 1
  m_RendererPriority: 0
  m_Materials:
  - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
  m_StaticBatchInfo:
    firstSubMesh: 0
    subMeshCount: 0
  m_StaticBatchRoot: {fileID: 0}
  m_ProbeAnchor: {fileID: 0}
  m_LightProbeVolumeOverride: {fileID: 0}
  m_ScaleInLightmap: 1
  m_ReceiveGI: 1
  m_PreserveUVs: 0
  m_IgnoreNormalsForChartDetection: 0
  m_ImportantGI: 0
  m_StitchLightmapSeams: 1
  m_SelectedEditorRenderState: 0
  m_MinimumChartSize: 4
  m_AutoUVMaxDistance: 0.5
  m_AutoUVMaxAngle: 89
  m_LightmapParameters: {fileID: 0}
  m_SortingLayerID: 0
  m_SortingLayer: 0
  m_SortingOrder: 0
  m_ChunkSize: {x: 32, y: 32, z: 32}
  m_ChunkCullingBounds: {x: 0, y: 0, z: 0}
  m_MaxChunkCount: 16
  m_MaxFrameAge: 16
  m_SortOrder: 0
  m_Mode: 0
  m_DetectChunkCullingBounds: 0
  m_MaskInteraction: 0
--- !u!1 &8103743555625331850
GameObject:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  serializedVersion: 6
  m_Component:
  - component: {fileID: 7503721036071197686}
  - component: {fileID: 7110305102789512434}
  m_Layer: 0
  m_Name: FogPalette
  m_TagString: Untagged
  m_Icon: {fileID: 0}
  m_NavMeshLayer: 0
  m_StaticEditorFlags: 0
  m_IsActive: 1
--- !u!4 &7503721036071197686
Transform:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 8103743555625331850}
  serializedVersion: 2
  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
  m_LocalPosition: {x: 0, y: 0, z: 0}
  m_LocalScale: {x: 1, y: 1, z: 1}
  m_ConstrainProportionsScale: 0
  m_Children:
  - {fileID: 4892262843372918448}
  m_Father: {fileID: 0}
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!156049354 &7110305102789512434
Grid:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 8103743555625331850}
  m_Enabled: 1
  m_CellSize: {x: 1, y: 1, z: 0}
  m_CellGap: {x: 0, y: 0, z: 0}
  m_CellLayout: 0
  m_CellSwizzle: 0
--- !u!114 &2918891380382392679
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 12395, guid: 0000000000000000e000000000000000, type: 0}
  m_Name: Palette Settings
  m_EditorClassIdentifier:
  cellSizing: 0
  m_TransparencySortMode: 0
  m_TransparencySortAxis: {x: 0, y: 0, z: 1}
Assets/TileSets/Palettes/FogPalette.prefab.meta
New file
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6aa480c46be44b64caf4373f699bf162
PrefabImporter:
  externalObjects: {}
  userData:
  assetBundleName:
  assetBundleVariant:
Assets/TileSets/Palettes/ForestTileset.prefab
@@ -46,10 +46,10 @@
    second:
      serializedVersion: 2
      m_TileIndex: 75
      m_TileSpriteIndex: 0
      m_TileSpriteIndex: 20
      m_TileMatrixIndex: 0
      m_TileColorIndex: 0
      m_TileObjectToInstantiateIndex: 65535
      m_TileObjectToInstantiateIndex: 0
      dummyAlignment: 0
      m_AllTileFlags: 1073741826
  - first: {x: -7, y: 2, z: 0}
@@ -957,7 +957,7 @@
  - m_RefCount: 1
    m_Data: {fileID: 11400000, guid: e77c00aec3ec74f4a9ec15ef63c3f9a7, type: 2}
  m_TileSpriteArray:
  - m_RefCount: 2
  - m_RefCount: 1
    m_Data: {fileID: -1200237691, guid: 42962cf14c23fee4baaaea0cd52d52e0, type: 3}
  - m_RefCount: 1
    m_Data: {fileID: -1554015212, guid: 42962cf14c23fee4baaaea0cd52d52e0, type: 3}
@@ -997,7 +997,7 @@
    m_Data: {fileID: 1598334396, guid: 42962cf14c23fee4baaaea0cd52d52e0, type: 3}
  - m_RefCount: 1
    m_Data: {fileID: 1451081626, guid: 42962cf14c23fee4baaaea0cd52d52e0, type: 3}
  - m_RefCount: 1
  - m_RefCount: 2
    m_Data: {fileID: 1943074245, guid: 42962cf14c23fee4baaaea0cd52d52e0, type: 3}
  - m_RefCount: 1
    m_Data: {fileID: 1932619806, guid: 42962cf14c23fee4baaaea0cd52d52e0, type: 3}
@@ -1129,7 +1129,9 @@
  m_TileColorArray:
  - m_RefCount: 76
    m_Data: {r: 1, g: 1, b: 1, a: 1}
  m_TileObjectToInstantiateArray: []
  m_TileObjectToInstantiateArray:
  - m_RefCount: 1
    m_Data: {fileID: 3549545049718014148, guid: c82bc431abdeded4ab41cfdd19459501, type: 3}
  m_AnimationFrameRate: 1
  m_Color: {r: 1, g: 1, b: 1, a: 1}
  m_Origin: {x: -7, y: -1, z: 0}
@@ -1247,7 +1249,7 @@
  m_CellGap: {x: 0, y: 0, z: 0}
  m_CellLayout: 0
  m_CellSwizzle: 0
--- !u!114 &6290011975362041633
--- !u!114 &1673799432531983012
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}