Commit 4ee466a6 authored by 18손재민's avatar 18손재민

모든 방 프리팹들 타일 고침. 그리고 플랫폼이랑 로프, 가시 타일 변경 코드 고침

parent 9acbeb95
......@@ -50,7 +50,7 @@ TextureImporter:
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
spriteTessellationDetail: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
......@@ -95,7 +95,11 @@ TextureImporter:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
physicsShape:
- - {x: 6, y: 32}
- {x: -6, y: 32}
- {x: -6, y: -32}
- {x: 6, y: -32}
bones: []
spriteID: 2d96d4533e0163846bffbe339f26e621
vertices: []
......
......@@ -130,7 +130,7 @@ TilemapRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_ChunkSize: {x: 32, y: 32, z: 32}
m_ChunkCullingBounds: {x: 0, y: 0, z: 0}
m_ChunkCullingBounds: {x: 0, y: 0.5, z: 0}
m_MaxChunkCount: 16
m_MaxFrameAge: 16
m_SortOrder: 0
......@@ -326,9 +326,9 @@ Tilemap:
- m_RefCount: 10
m_Data: {r: 1, g: 1, b: 1, a: 1}
- m_RefCount: 1
m_Data: {r: 0.9840801, g: 0.4219899, b: 0.4725202, a: 1}
m_Data: {r: 0.8524666, g: 0.36087945, b: 0.4447756, a: 1}
- m_RefCount: 1
m_Data: {r: 0.8376917, g: 0.42838743, b: 0.55295527, a: 1}
m_Data: {r: 0.84723735, g: 0.36042166, b: 0.49818724, a: 1}
m_AnimationFrameRate: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Origin: {x: -3, y: -2, z: 0}
......
......@@ -56,7 +56,7 @@ MonoBehaviour:
grid: {fileID: 0}
initialFallSpeed: -0.1
gravity: 0.98
timeToFallTetrimino: 30
timeToFallTetrimino: 100
tetriminoWaitedTime: 0
tetriminoCreatedTime: 0
collapseTime: 10
......@@ -133,7 +133,6 @@ MonoBehaviour:
- {fileID: 114384035641513528, guid: a2dadbc92c7cc7e449233fae6430dee7, type: 2}
- {fileID: 114704192105535744, guid: a121f45347e4c3d4faf83b4e681c84f0, type: 2}
- {fileID: 114792926073732986, guid: 0443c2e9410bbe545bda40dc30fa6a63, type: 2}
- {fileID: 114155825416261646, guid: 7ecb75df9a2e95647b4a221c95b9f4f0, type: 2}
- {fileID: 114844722971494232, guid: 4643eac2d148bd146be89238dcdfa419, type: 2}
specialRoomList2:
- {fileID: 114330503780891850, guid: 7da800d1a4355fd4aa02e3518cd9e1fb, type: 2}
......@@ -145,7 +144,6 @@ MonoBehaviour:
- {fileID: 114384035641513528, guid: a2dadbc92c7cc7e449233fae6430dee7, type: 2}
- {fileID: 114704192105535744, guid: a121f45347e4c3d4faf83b4e681c84f0, type: 2}
- {fileID: 114792926073732986, guid: 0443c2e9410bbe545bda40dc30fa6a63, type: 2}
- {fileID: 114155825416261646, guid: 7ecb75df9a2e95647b4a221c95b9f4f0, type: 2}
- {fileID: 114844722971494232, guid: 4643eac2d148bd146be89238dcdfa419, type: 2}
roomSurfaceSprite1:
- {fileID: 21300000, guid: 5e6d29c00a95b8140a33c81d93aac0b2, type: 3}
......@@ -373,6 +371,26 @@ MonoBehaviour:
- {fileID: 11400000, guid: 6c9bb38cfe5980245989e834385f7b2c, type: 2}
- {fileID: 11400000, guid: 16924b8ecf8bd1940902343766fc4cdc, type: 2}
- {fileID: 11400000, guid: b556ab3a4d3d2db4b89081d94cca006c, type: 2}
allPlatformTiles: []
allSpikeTiles: []
allRopeTiles: []
allPlatformTiles:
- {fileID: 11400000, guid: c25a20f570a6e474bb000881122106f7, type: 2}
- {fileID: 11400000, guid: 60035ce64a779ae4a9eeaaafe33f87e1, type: 2}
- {fileID: 11400000, guid: 9e0a3a715e976bb489ec8bedeeb2ab32, type: 2}
- {fileID: 11400000, guid: 3d63c558a17627b4c8a6eff233ae9aff, type: 2}
- {fileID: 11400000, guid: 0aa25d9458a285146be0f80438fbcac8, type: 2}
- {fileID: 11400000, guid: 8e289c63850dcb34a94a8cc69a245ed7, type: 2}
allRopeTiles:
- {fileID: 11400000, guid: 7fcb9c110fd1807479e950e97e3a09e4, type: 2}
- {fileID: 11400000, guid: 9f29d7f8294254245ba40ce099df2eda, type: 2}
- {fileID: 11400000, guid: 3c532ce77a13dca448f232a5f07b30b0, type: 2}
- {fileID: 11400000, guid: 6194ca365d1997a42979814a8ea47551, type: 2}
- {fileID: 11400000, guid: 7fe9bb41f3464d64c89f13c75fc4382f, type: 2}
- {fileID: 11400000, guid: f5d78fcc466db9a4183678471465678b, type: 2}
allSpikeTiles:
- {fileID: 11400000, guid: f411e29431b787c4ab84b5ff59ca5e6e, type: 2}
- {fileID: 11400000, guid: 85440e0dd81e48840947ce485614bab6, type: 2}
- {fileID: 11400000, guid: 7dbb7c55a3417f54fbd38fafb369478e, type: 2}
- {fileID: 11400000, guid: 7f2c5cb43ad7207499b22fb5e0acd41a, type: 2}
- {fileID: 11400000, guid: 034d5fb04a013124cb432284fdc8c423, type: 2}
- {fileID: 11400000, guid: f6a8681f94ddcf24eac96d8e4a5c82f6, type: 2}
- {fileID: 11400000, guid: 69359808565f98f4297a6efb8da5c4da, type: 2}
- {fileID: 11400000, guid: f9cdf78c8a087c94a9279cc07fc03a25, type: 2}
This diff is collapsed.
fileFormatVersion: 2
guid: f33122f108dee304694094731aa8ec4f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 605480f421d8a99499d2a18f171f59f8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 7ecb75df9a2e95647b4a221c95b9f4f0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
......@@ -34,7 +34,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1704656476422024}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 48, y: 0, z: -2}
m_LocalPosition: {x: 168, y: 0, z: -2}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
......
fileFormatVersion: 2
guid: 7fcb9c110fd1807479e950e97e3a09e4
guid: 3c532ce77a13dca448f232a5f07b30b0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -11,7 +11,7 @@ MonoBehaviour:
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 11roped
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, type: 3}
m_Sprite: {fileID: 21300000, guid: a7ade53056ed4934c87daaec91a44354, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
......@@ -11,7 +11,7 @@ MonoBehaviour:
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 11ropeu
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, type: 3}
m_Sprite: {fileID: 21300000, guid: 45bbd91799285994eb276ebedd1d1469, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
fileFormatVersion: 2
guid: 3c532ce77a13dca448f232a5f07b30b0
guid: 7fcb9c110fd1807479e950e97e3a09e4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6194ca365d1997a42979814a8ea47551
guid: f5d78fcc466db9a4183678471465678b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -11,7 +11,7 @@ MonoBehaviour:
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12roped
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, type: 3}
m_Sprite: {fileID: 21300000, guid: a7ade53056ed4934c87daaec91a44354, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
......@@ -11,7 +11,7 @@ MonoBehaviour:
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12ropeu
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, type: 3}
m_Sprite: {fileID: 21300000, guid: 45bbd91799285994eb276ebedd1d1469, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
fileFormatVersion: 2
guid: f5d78fcc466db9a4183678471465678b
guid: 6194ca365d1997a42979814a8ea47551
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -11,7 +11,7 @@ MonoBehaviour:
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12spiked
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: d17f08c78e4eeee4d9720ba726b4944a, type: 3}
m_Sprite: {fileID: 21300000, guid: 7ee765cc5330a444db118a031abd5b9e, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
......@@ -11,7 +11,7 @@ MonoBehaviour:
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12spikeu
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 7ee765cc5330a444db118a031abd5b9e, type: 3}
m_Sprite: {fileID: 21300000, guid: d17f08c78e4eeee4d9720ba726b4944a, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
......@@ -54,6 +54,4 @@ public enum RoomType { Start, Item, BothSide, Gold, Amethyst, Boss, Normal }
/// <summary>
/// Enum for room's sprite types.
/// </summary>
public enum RoomSpriteType { Item, BothSide, Gold, Amethyst, Boss, Normal1, Normal2, Nomal3, Normal4 }
public enum TileType { None, Wall, Rope, Platform, Spike }
\ No newline at end of file
public enum RoomSpriteType { Item, BothSide, Gold, Amethyst, Boss, Normal1, Normal2, Nomal3, Normal4 }
\ No newline at end of file
......@@ -13,7 +13,10 @@ public class RoomInGame : MonoBehaviour {
/// Information for stage.
/// </summary>
public bool[] concept = new bool[4];
public int[,] tileInfo = new int[24, 24];
public bool[,] wallTileInfo = new bool[24, 24];
public bool[,] platformTileInfo = new bool[24, 24];
public bool[,] ropeTileInfo = new bool[24, 24];
public bool[,] spikeTileInfo = new bool[24, 24];
/*
* functions
......
......@@ -3,8 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
public class TileManager : MonoBehaviour
{
public class TileManager : MonoBehaviour {
/// <summary>
/// Array of all wall tiles.
/// </summary>
......@@ -14,14 +13,14 @@ public class TileManager : MonoBehaviour
/// </summary>
public TileBase[] allPlatformTiles;
/// <summary>
/// Array of all spike tiles.
/// </summary>
public TileBase[] allSpikeTiles;
/// <summary>
/// Array of all rope tiles.
/// </summary>
public TileBase[] allRopeTiles;
/// <summary>
/// Array of all spike tiles.
/// </summary>
public TileBase[] allSpikeTiles;
/// <summary>
/// Dictionary for distributing all wall tiles.
/// Each dimensions for stage and concept.
/// </summary>
......@@ -50,33 +49,19 @@ public class TileManager : MonoBehaviour
{
Tilemap wallTileMap = roomInGame.transform.Find("wall").GetComponent<Tilemap>();
Tilemap platformTileMap = roomInGame.transform.Find("platform").GetComponent<Tilemap>();
Tilemap spikeTileMap = roomInGame.transform.Find("spike").GetComponent<Tilemap>();
Tilemap ropeTileMap = roomInGame.transform.Find("rope").GetComponent<Tilemap>();
Tilemap spikeTileMap = roomInGame.transform.Find("spike").GetComponent<Tilemap>();
for (int x = 0; x < 24; x++)
for(int y = 0; y < 24; y++)
{
if (wallTileMap.GetTile(new Vector3Int(x, y, 0)))
{
roomInGame.tileInfo[x, y] = (int)TileType.Wall;
continue;
}
else if (platformTileMap.GetTile(new Vector3Int(x, y, 0)))
{
roomInGame.tileInfo[x, y] = (int)TileType.Platform;
continue;
}
else if (spikeTileMap.GetTile(new Vector3Int(x, y, 0)))
{
roomInGame.tileInfo[x, y] = (int)TileType.Spike;
continue;
}
else if (ropeTileMap.GetTile(new Vector3Int(x, y, 0)))
{
roomInGame.tileInfo[x, y] = (int)TileType.Rope;
continue;
}
else
roomInGame.tileInfo[x, y] = (int)TileType.None;
roomInGame.wallTileInfo[x, y] = true;
if (platformTileMap.GetTile(new Vector3Int(x, y, 0)))
roomInGame.platformTileInfo[x, y] = true;
if (ropeTileMap.GetTile(new Vector3Int(x, y, 0)))
roomInGame.ropeTileInfo[x, y] = true;
if (spikeTileMap.GetTile(new Vector3Int(x, y, 0)))
roomInGame.spikeTileInfo[x, y] = true;
}
}
/// <summary>
......@@ -91,11 +76,11 @@ public class TileManager : MonoBehaviour
int verticalTile = 0, horizontalTile = 0;
if (!IsTileInRoom(originPos.x + checkPos.x))
horizontalTile = 2;
else if (roomInGame.tileInfo[originPos.x + checkPos.x, originPos.y] == (int)TileType.Wall)
else if (roomInGame.wallTileInfo[originPos.x + checkPos.x, originPos.y])
horizontalTile = 1;
if (!IsTileInRoom(originPos.y + checkPos.y))
verticalTile = 2;
else if (roomInGame.tileInfo[originPos.x, originPos.y + checkPos.y] == (int)TileType.Wall)
else if (roomInGame.wallTileInfo[originPos.x, originPos.y + checkPos.y])
verticalTile = 1;
if ((verticalTile == 2 && horizontalTile == 2) || (verticalTile == 0 && horizontalTile == 2) || (verticalTile == 2 && horizontalTile == 0))
return '3';
......@@ -105,7 +90,7 @@ public class TileManager : MonoBehaviour
return '2';
else if (verticalTile == 1 && horizontalTile == 1)
{
if (roomInGame.tileInfo[originPos.x + checkPos.x, originPos.y + checkPos.y] == (int)TileType.Wall)
if (roomInGame.wallTileInfo[originPos.x + checkPos.x, originPos.y + checkPos.y])
return 'o';
else
return 's';
......@@ -120,9 +105,9 @@ public class TileManager : MonoBehaviour
public char CheckPlatformTile(RoomInGame roomInGame, Vector2Int originPos)
{
bool left = false, right = false;
if(roomInGame.tileInfo[originPos.x + 1, originPos.y] == (int)TileType.Platform)
if(roomInGame.platformTileInfo[originPos.x + 1, originPos.y])
right = true;
if (roomInGame.tileInfo[originPos.x - 1, originPos.y] == (int)TileType.Platform)
if (roomInGame.platformTileInfo[originPos.x - 1, originPos.y])
left = true;
if (left && right)
return 'c';
......@@ -136,9 +121,9 @@ public class TileManager : MonoBehaviour
public char CheckRopeTile(RoomInGame roomInGame, Vector2Int originPos)
{
bool up = false, down = false;
if (roomInGame.tileInfo[originPos.x, originPos.y + 1] == (int)TileType.Platform)
if (roomInGame.ropeTileInfo[originPos.x, originPos.y + 1])
up = true;
if (roomInGame.tileInfo[originPos.x, originPos.y - 1] == (int)TileType.Platform)
if (roomInGame.ropeTileInfo[originPos.x, originPos.y - 1])
down = true;
if (up && down)
return 'c';
......@@ -149,11 +134,11 @@ public class TileManager : MonoBehaviour
}
public char CheckSpikeTile(RoomInGame roomInGame, Vector2Int originPos)
{
if (roomInGame.tileInfo[originPos.x + 1, originPos.y] == (int)TileType.Wall)
return 'r';
else if (roomInGame.tileInfo[originPos.x - 1, originPos.y] == (int)TileType.Wall)
if (roomInGame.wallTileInfo[originPos.x + 1, originPos.y])
return 'l';
else if (roomInGame.tileInfo[originPos.x, originPos.y + 1] == (int)TileType.Wall)
else if (roomInGame.wallTileInfo[originPos.x - 1, originPos.y])
return 'r';
else if (roomInGame.wallTileInfo[originPos.x, originPos.y + 1])
return 'd';
else
return 'u';
......@@ -181,8 +166,8 @@ public class TileManager : MonoBehaviour
RoomInGame roomInGame = room.roomInGame;
Tilemap wallTileMap = roomInGame.transform.Find("wall").GetComponent<Tilemap>();
Tilemap platformTileMap = roomInGame.transform.Find("platform").GetComponent<Tilemap>();
Tilemap spikeTileMap = roomInGame.transform.Find("spike").GetComponent<Tilemap>();
Tilemap ropeTileMap = roomInGame.transform.Find("rope").GetComponent<Tilemap>();
Tilemap spikeTileMap = roomInGame.transform.Find("spike").GetComponent<Tilemap>();
CheckAllTiles(roomInGame);
for(int y = 0; y < 24; y++)
{
......@@ -190,7 +175,7 @@ public class TileManager : MonoBehaviour
yield return null;*/
for(int x = 0; x < 24; x++)
{
if (roomInGame.tileInfo[x, y] == (int)TileType.Wall)
if (roomInGame.wallTileInfo[x, y])
{
string tileName = CheckWallQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(-1, 1)).ToString() +
CheckWallQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(1, 1)).ToString() +
......@@ -199,21 +184,21 @@ public class TileManager : MonoBehaviour
if(wallTilesDistributed[stage, concept].ContainsKey(tileName))
wallTileMap.SetTile(new Vector3Int(x, y, 0), wallTilesDistributed[stage, concept][tileName]);
}
else if (roomInGame.tileInfo[x, y] == (int)TileType.Platform && y != 0 && y != 23)
if (roomInGame.platformTileInfo[x, y] && y != 0 && y != 23)
{
string tileName = CheckPlatformTile(roomInGame, new Vector2Int(x, y)).ToString();
if (platformTilesDistributed[stage, concept].ContainsKey(tileName))
platformTileMap.SetTile(new Vector3Int(x, y, 0), platformTilesDistributed[stage, concept][tileName]);
}
else if (roomInGame.tileInfo[x, y] == (int)TileType.Rope)
if (roomInGame.ropeTileInfo[x, y])
{
string tileName = CheckRopeTile(roomInGame, new Vector2Int(x, y)).ToString();
if (ropeTilesDistributed[stage, concept].ContainsKey(tileName))
ropeTileMap.SetTile(new Vector3Int(x, y, 0), ropeTilesDistributed[stage, concept][tileName]);
}
else if (roomInGame.tileInfo[x, y] == (int)TileType.Spike)
if (roomInGame.spikeTileInfo[x, y])
{
string tileName = CheckRopeTile(roomInGame, new Vector2Int(x, y)).ToString();
string tileName = CheckSpikeTile(roomInGame, new Vector2Int(x, y)).ToString();
if (spikeTilesDistributed[stage, concept].ContainsKey(tileName))
spikeTileMap.SetTile(new Vector3Int(x, y, 0), spikeTilesDistributed[stage, concept][tileName]);
}
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment