Commit 9acbeb95 authored by 18손재민's avatar 18손재민

플랫폼이랑 로프 가시 타일 찍는거 만듬

parent 6c9e5bfa
......@@ -5,9 +5,8 @@ using UnityEngine;
public class CloseDoor : StateMachineBehaviour {
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
MapManager.isDoorWorking = true;
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
animator.transform.parent.GetComponent<Room>().isDoorWorking = true;
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
......@@ -16,9 +15,8 @@ public class CloseDoor : StateMachineBehaviour {
//}
//OnStateExit is called when a transition ends and the state machine finishes evaluating this state
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
MapManager.isDoorWorking = false;
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
animator.transform.parent.GetComponent<Room>().isDoorWorking = false;
}
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
......
......@@ -6,7 +6,7 @@ public class OpenDoor : StateMachineBehaviour {
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
MapManager.isDoorWorking = true;
animator.transform.parent.GetComponent<Room>().isDoorWorking = true;
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
......@@ -16,7 +16,7 @@ public class OpenDoor : StateMachineBehaviour {
//OnStateExit is called when a transition ends and the state machine finishes evaluating this state
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
MapManager.isDoorWorking = false;
animator.transform.parent.GetComponent<Room>().isDoorWorking = false;
}
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
......
fileFormatVersion: 2
guid: f29465d502250714a9f25df6aaaeab1d
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 6
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 9
spritePivot: {x: 0.5, y: -0.475}
spritePixelsToUnits: 64
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: d7becf54080f9e6428aee6f71a7fcfe6
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 35acb4a1959d8114092813b66a3b25de
guid: 1be7ce8972ae2fb4a84717e42243e5b4
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
......@@ -31,7 +31,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
......@@ -44,7 +44,7 @@ TextureImporter:
spriteExtrude: 1
spriteMeshType: 1
alignment: 9
spritePivot: {x: 0.5, y: -0.075}
spritePivot: {x: 0.5, y: -0.475}
spritePixelsToUnits: 64
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
......@@ -80,13 +80,24 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: cb9c233e408643448bf5f29857585bc2
spriteID: 2af27cb60dcdd9d4fab584f4cb316982
vertices: []
indices:
edges: []
......
fileFormatVersion: 2
guid: 7258c55f6670d424891e2b6b63208168
guid: 304a5c9639335dc419e62424768222f4
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
......@@ -31,7 +31,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
......@@ -44,7 +44,7 @@ TextureImporter:
spriteExtrude: 1
spriteMeshType: 1
alignment: 9
spritePivot: {x: 0.5, y: -0.075}
spritePivot: {x: 0.5, y: -0.475}
spritePixelsToUnits: 64
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
......@@ -80,13 +80,24 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 793e583acbc98ba4cb68007cd7238fa4
spriteID: 09461831bdaa150419335631c5d7d0f5
vertices: []
indices:
edges: []
......
......@@ -188,7 +188,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: adab373df646d5f4fb794a3b6ffdf2d7, type: 3}
m_Name:
m_EditorClassIdentifier:
allTiles:
allWallTiles:
- {fileID: 11400000, guid: cad5b727dcc80234584fe4c3d4bac3ac, type: 2}
- {fileID: 11400000, guid: 648b887233c145948994a645b8a15292, type: 2}
- {fileID: 11400000, guid: ac15a9d37231f6d4f94081f8ea438ca2, type: 2}
......@@ -208,6 +208,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: be5b9f120ea162a4fae348edd1700256, type: 2}
- {fileID: 11400000, guid: c161c4b186dd4aa40941aa3873d6c5ec, type: 2}
- {fileID: 11400000, guid: 4bc30c62b57fe2b4ea26b12ed4f64616, type: 2}
- {fileID: 11400000, guid: 4fb31c87ddf259948b8873bc66601f9d, type: 2}
- {fileID: 11400000, guid: fed924c0de37ea54d9cf7f8c1b023415, type: 2}
- {fileID: 11400000, guid: c20cd0b9e189f6843a083d396400fc3f, type: 2}
- {fileID: 11400000, guid: 04f046ca64f78cf46ad40b850a92eb82, type: 2}
......@@ -215,6 +216,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: 043ac57223c8ae54fa327e6bcc9e7521, type: 2}
- {fileID: 11400000, guid: 669e8afc72c10884ea7947b22f2b2fc3, type: 2}
- {fileID: 11400000, guid: f2e0d651aceb3794684dc5054419e5ac, type: 2}
- {fileID: 11400000, guid: 38e0da454028d824eb49f43f987ad562, type: 2}
- {fileID: 11400000, guid: 0138237a8bdcade46a3fbc010a084e2d, type: 2}
- {fileID: 11400000, guid: 0052bfa029fde2d4da209f3a415d4d13, type: 2}
- {fileID: 11400000, guid: dd57f268277a5cb4c8d4565b2e147589, type: 2}
......@@ -240,12 +242,14 @@ MonoBehaviour:
- {fileID: 11400000, guid: f221214a2c33408408e6465b9b62707b, type: 2}
- {fileID: 11400000, guid: 658696c04dfc5c4438eb2f0306e10f12, type: 2}
- {fileID: 11400000, guid: 78b3f2e87b92cee4e88fe15a5aabef92, type: 2}
- {fileID: 11400000, guid: 8efe05cd62495f24cb1155c956789098, type: 2}
- {fileID: 11400000, guid: e098a71dffeef434782b487a75cfaab6, type: 2}
- {fileID: 11400000, guid: 43ce5674905ab684096018dc998da9bf, type: 2}
- {fileID: 11400000, guid: 928a04c9f7e45fb4180c93cd01cd0bab, type: 2}
- {fileID: 11400000, guid: ba7bc116ed9339d409f01707034be181, type: 2}
- {fileID: 11400000, guid: 2967ea61b7da1db4c82ad335fabe0a79, type: 2}
- {fileID: 11400000, guid: 891953fcb438d3d43b96fbe5346a10d0, type: 2}
- {fileID: 11400000, guid: 12c5767f0650c0c4a85c5a32a133eaf6, type: 2}
- {fileID: 11400000, guid: 2548ea7ff23f65e44ab5230199dd5ffd, type: 2}
- {fileID: 11400000, guid: 41e7ff0cd05627b4e8748e9f8710ae4a, type: 2}
- {fileID: 11400000, guid: 7967111718d293949b91d353e305d41b, type: 2}
......@@ -277,7 +281,6 @@ MonoBehaviour:
- {fileID: 11400000, guid: da9aae37520c9aa4ab16621fa2143b4f, type: 2}
- {fileID: 11400000, guid: 8053217ed4b04674990f6fd04049e6a4, type: 2}
- {fileID: 11400000, guid: b5fcd2f2e4c67fc43a358769246cbc31, type: 2}
- {fileID: 11400000, guid: 12c5767f0650c0c4a85c5a32a133eaf6, type: 2}
- {fileID: 11400000, guid: 25f7a0be713ce754d98b870dae1dae86, type: 2}
- {fileID: 11400000, guid: a3565f5943a1f284ab63d05dc8201a90, type: 2}
- {fileID: 11400000, guid: b88eb1e8a0c6c0f4ba5d4c976857b2e3, type: 2}
......@@ -297,6 +300,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: 9e71e2279417c3e459818ff17dc2aa6f, type: 2}
- {fileID: 11400000, guid: f9a5831fc493fda4e93cbac99e6c2989, type: 2}
- {fileID: 11400000, guid: 8e4e19774b53b3b479fa49ae4531846d, type: 2}
- {fileID: 11400000, guid: 985d2d01d390234479b19ba82d087c9a, type: 2}
- {fileID: 11400000, guid: fa36548597559674ba8ede1df55ff446, type: 2}
- {fileID: 11400000, guid: f38eb44ce290981488b1f0a6650a1321, type: 2}
- {fileID: 11400000, guid: 74d06422771b0a74fad67f27f43ab99d, type: 2}
......@@ -304,6 +308,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: 2725f2e13258bfa408f04b5d4c938e91, type: 2}
- {fileID: 11400000, guid: 630f50efb34ebce4783e3ab8f181a083, type: 2}
- {fileID: 11400000, guid: 6a3814c0058eac04495b715af3003a24, type: 2}
- {fileID: 11400000, guid: 4b7c85e4ddcad124e8dcb69e856229ce, type: 2}
- {fileID: 11400000, guid: 42712b4bca9b6cb49bda3a74bd6948d3, type: 2}
- {fileID: 11400000, guid: e86502c95a7831241aced30d4a3a82f2, type: 2}
- {fileID: 11400000, guid: 1872608f0bf4efb44b36692b5e975fe1, type: 2}
......@@ -329,6 +334,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: 4d99cea3393676849837d044c18df92e, type: 2}
- {fileID: 11400000, guid: b7e02c7a90dcb394891abe252e79fab7, type: 2}
- {fileID: 11400000, guid: 16a4ad4d15aa9a74f90ae19f1a5f3295, type: 2}
- {fileID: 11400000, guid: 11005e6e7c04a3f429b4364af2397029, type: 2}
- {fileID: 11400000, guid: e708c99b2707b8f45996315fd5371a41, type: 2}
- {fileID: 11400000, guid: b32979c2652abc747876e31c8bb0009d, type: 2}
- {fileID: 11400000, guid: a0d815bc368d4a64ea57aa62df7bdc64, type: 2}
......@@ -367,3 +373,6 @@ MonoBehaviour:
- {fileID: 11400000, guid: 6c9bb38cfe5980245989e834385f7b2c, type: 2}
- {fileID: 11400000, guid: 16924b8ecf8bd1940902343766fc4cdc, type: 2}
- {fileID: 11400000, guid: b556ab3a4d3d2db4b89081d94cca006c, type: 2}
allPlatformTiles: []
allSpikeTiles: []
allRopeTiles: []
......@@ -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: 96, y: 0, z: -2}
m_LocalPosition: {x: 48, y: 0, z: -2}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 11platformc
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: f29465d502250714a9f25df6aaaeab1d, 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
fileFormatVersion: 2
guid: c25a20f570a6e474bb000881122106f7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 11platforml
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 1be7ce8972ae2fb4a84717e42243e5b4, 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
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 11platformr
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 304a5c9639335dc419e62424768222f4, 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
fileFormatVersion: 2
guid: bcd281c1dc90f034ba740838bd9d4e34
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,7 +9,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: rope
m_Name: 11ropec
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......
fileFormatVersion: 2
guid: 7fcb9c110fd1807479e950e97e3a09e4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 11roped
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, 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
fileFormatVersion: 2
guid: 9f29d7f8294254245ba40ce099df2eda
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 11ropeu
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, 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
fileFormatVersion: 2
guid: 10767297791584c499054e78459055e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,7 +9,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: spikedown
m_Name: 11spiked
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: d17f08c78e4eeee4d9720ba726b4944a, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......
......@@ -9,7 +9,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: spikeleft
m_Name: 11spikel
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 59bbc71eb892afa47b6fc1e759d4fc7c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......
......@@ -9,7 +9,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: spikeright
m_Name: 11spiker
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: ae1d646541c9b9647af41abd213aaaa2, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......
......@@ -9,7 +9,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: spikeup
m_Name: 11spikeu
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 7ee765cc5330a444db118a031abd5b9e, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......
fileFormatVersion: 2
guid: 61956219e235d92418b6eb5cdf861fdc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12platformc
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: f29465d502250714a9f25df6aaaeab1d, 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
fileFormatVersion: 2
guid: 3d63c558a17627b4c8a6eff233ae9aff
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12platforml
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 1be7ce8972ae2fb4a84717e42243e5b4, 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
fileFormatVersion: 2
guid: 0aa25d9458a285146be0f80438fbcac8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12platformr
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 304a5c9639335dc419e62424768222f4, 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
fileFormatVersion: 2
guid: 8e289c63850dcb34a94a8cc69a245ed7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,9 +9,9 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: platform_left
m_Name: doorPlatform_left
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 35acb4a1959d8114092813b66a3b25de, type: 3}
m_Sprite: {fileID: 21300000, guid: ad46987f159f472428d27c0b4c63e4f9, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
fileFormatVersion: 2
guid: 7c884f51948933b4083bd22802ebef55
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,9 +9,9 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: platform_right
m_Name: doorPlatform_right
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 7258c55f6670d424891e2b6b63208168, type: 3}
m_Sprite: {fileID: 21300000, guid: 6427ea4de61aaec43a19c26ff2448cbd, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Transform:
e00: 1
......
fileFormatVersion: 2
guid: 8ef231c684a0b4a4bb6932f185c8b14d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: platform
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 14caea13cbaabe84aae40a958d520cbe, 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
fileFormatVersion: 2
guid: 0b301b7d5f138b248aeeb6f0f984b45d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a9decf50d039c214590a55db99f9c313
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12ropec
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, 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
fileFormatVersion: 2
guid: 6194ca365d1997a42979814a8ea47551
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12roped
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, 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
fileFormatVersion: 2
guid: 7fe9bb41f3464d64c89f13c75fc4382f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12ropeu
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 57dcdd6fd2364b24ea278d98c99953f8, 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
fileFormatVersion: 2
guid: f5d78fcc466db9a4183678471465678b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1ddba3176905eb34a84d3b886657fa78
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12spiked
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: d17f08c78e4eeee4d9720ba726b4944a, 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
fileFormatVersion: 2
guid: 034d5fb04a013124cb432284fdc8c423
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12spikel
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 59bbc71eb892afa47b6fc1e759d4fc7c, 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
fileFormatVersion: 2
guid: f6a8681f94ddcf24eac96d8e4a5c82f6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12spiker
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: ae1d646541c9b9647af41abd213aaaa2, 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
fileFormatVersion: 2
guid: 69359808565f98f4297a6efb8da5c4da
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: 12spikeu
m_EditorClassIdentifier:
m_Sprite: {fileID: 21300000, guid: 7ee765cc5330a444db118a031abd5b9e, 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
fileFormatVersion: 2
guid: f9cdf78c8a087c94a9279cc07fc03a25
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -114,7 +114,7 @@ public class PlayerController : MonoBehaviour
isGrounded = tmp;
if (GameManager.gameState == GameState.Ingame && MapManager.isDoorWorking != true)
if (GameManager.gameState == GameState.Ingame && MapManager.currentRoom.isDoorWorking != true)
{
if (playerState == PlayerState.Attack)
......
......@@ -55,3 +55,5 @@ public enum RoomType { Start, Item, BothSide, Gold, Amethyst, Boss, Normal }
/// 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
......@@ -82,10 +82,6 @@ public class MapManager : MonoBehaviour {
/// </summary>
public static bool isRoomFalling = false;
/// <summary>
/// Check if door is closing or not.
/// </summary>
public static bool isDoorWorking = false;
/// <summary>
/// Check if this row is being deleted.
/// </summary>
public static bool[] isRowDeleting = new bool[20];
......@@ -885,7 +881,7 @@ public class MapManager : MonoBehaviour {
for (int i = 0; i < 20; i++)
{
if(i == 6)
isDoorWorking = false;
room.isDoorWorking = false;
yield return new WaitForSeconds(0.01f);
room.leftTetrisDoor.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, alpha);
room.rightTetrisDoor.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, alpha);
......
......@@ -88,6 +88,10 @@ public class Room : MonoBehaviour
/// </summary>
public bool isRoomCleared;
/// <summary>
/// Check if door is closing or not.
/// </summary>
public bool isDoorWorking = false;
/// <summary>
/// Check if room is destroyed.
/// </summary>
public bool isRoomDestroyed = false;
......
......@@ -13,7 +13,7 @@ public class RoomInGame : MonoBehaviour {
/// Information for stage.
/// </summary>
public bool[] concept = new bool[4];
public bool[,] tileInfo = new bool[24, 24];
public int[,] tileInfo = new int[24, 24];
/*
* functions
......
......@@ -6,41 +6,77 @@ using UnityEngine.Tilemaps;
public class TileManager : MonoBehaviour
{
/// <summary>
/// Array of all tiles.
/// Array of all wall tiles.
/// </summary>
public TileBase[] allTiles;
public TileBase[] allWallTiles;
/// <summary>
/// Dictionary for distributing all tiles.
/// Array of all platform tiles.
/// </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>
/// Dictionary for distributing all wall tiles.
/// Each dimensions for stage and concept.
/// </summary>
Dictionary<string, TileBase>[,] wallTilesDistributed = new Dictionary<string, TileBase>[5, 4];
/// <summary>
/// Dictionary for distributing all platform tiles.
/// Each dimensions for stage and concept.
/// </summary>
Dictionary<string, TileBase>[,] tilesDistributed = new Dictionary<string, TileBase>[5, 4];
Dictionary<string, TileBase>[,] platformTilesDistributed = new Dictionary<string, TileBase>[5, 4];
/// <summary>
/// Dictionary for distributing all spike tiles.
/// Each dimensions for stage and concept.
/// </summary>
Dictionary<string, TileBase>[,] spikeTilesDistributed = new Dictionary<string, TileBase>[5, 4];
/// <summary>
/// Dictionary for distributing all rope tiles.
/// Each dimensions for stage and concept.
/// </summary>
Dictionary<string, TileBase>[,] ropeTilesDistributed = new Dictionary<string, TileBase>[5, 4];
void Awake()
{
for (int i = 0; i < 5; i++)
for (int j = 0; j < 4; j++)
tilesDistributed[i, j] = new Dictionary<string, TileBase>();
string tileName;
for(int i = 0; i < allTiles.Length; i++)
{
tileName = allTiles[i].name;
tilesDistributed[int.Parse(tileName.Substring(0, 1)) - 1, int.Parse(tileName.Substring(1, 1)) - 1].Add(tileName.Substring(2), allTiles[i]);
}
}
/// <summary>
/// Check room's tilemap's all position that if tile exists there or not.
/// </summary>
/// <param name="roomInGame">Room you want to check.</param>
public void CheckAllTiles(RoomInGame roomInGame)
{
Tilemap roomTileMap = roomInGame.transform.Find("wall").GetComponent<Tilemap>();
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>();
for (int x = 0; x < 24; x++)
for(int y = 0; y < 24; y++)
{
if (roomTileMap.GetTile(new Vector3Int(x, y, 0)))
roomInGame.tileInfo[x, y] = true;
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] = false;
roomInGame.tileInfo[x, y] = (int)TileType.None;
}
}
/// <summary>
......@@ -50,17 +86,16 @@ public class TileManager : MonoBehaviour
/// <param name="originPos">Position of tile map you want to check.</param>
/// <param name="checkPos">Direction you want to check.</param>
/// <returns></returns>
public char CheckQuarterTile(RoomInGame roomInGame, Vector2Int originPos, Vector2Int checkPos)
public char CheckWallQuarterTile(RoomInGame roomInGame, Vector2Int originPos, Vector2Int checkPos)
{
int verticalTile = 0, horizontalTile = 0;
bool[,] tileInfo = roomInGame.tileInfo;
if (!IsTileInRoom(originPos.x + checkPos.x))
horizontalTile = 2;
else if (tileInfo[originPos.x + checkPos.x, originPos.y])
else if (roomInGame.tileInfo[originPos.x + checkPos.x, originPos.y] == (int)TileType.Wall)
horizontalTile = 1;
if (!IsTileInRoom(originPos.y + checkPos.y))
verticalTile = 2;
else if (tileInfo[originPos.x, originPos.y + checkPos.y])
else if (roomInGame.tileInfo[originPos.x, originPos.y + checkPos.y] == (int)TileType.Wall)
verticalTile = 1;
if ((verticalTile == 2 && horizontalTile == 2) || (verticalTile == 0 && horizontalTile == 2) || (verticalTile == 2 && horizontalTile == 0))
return '3';
......@@ -70,7 +105,7 @@ public class TileManager : MonoBehaviour
return '2';
else if (verticalTile == 1 && horizontalTile == 1)
{
if (tileInfo[originPos.x + checkPos.x, originPos.y + checkPos.y])
if (roomInGame.tileInfo[originPos.x + checkPos.x, originPos.y + checkPos.y] == (int)TileType.Wall)
return 'o';
else
return 's';
......@@ -82,6 +117,47 @@ public class TileManager : MonoBehaviour
else
return 'b';
}
public char CheckPlatformTile(RoomInGame roomInGame, Vector2Int originPos)
{
bool left = false, right = false;
if(roomInGame.tileInfo[originPos.x + 1, originPos.y] == (int)TileType.Platform)
right = true;
if (roomInGame.tileInfo[originPos.x - 1, originPos.y] == (int)TileType.Platform)
left = true;
if (left && right)
return 'c';
else if (left)
return 'r';
else if(right)
return 'l';
else
return 'c';
}
public char CheckRopeTile(RoomInGame roomInGame, Vector2Int originPos)
{
bool up = false, down = false;
if (roomInGame.tileInfo[originPos.x, originPos.y + 1] == (int)TileType.Platform)
up = true;
if (roomInGame.tileInfo[originPos.x, originPos.y - 1] == (int)TileType.Platform)
down = true;
if (up && down)
return 'c';
else if (up)
return 'd';
else
return 'u';
}
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)
return 'l';
else if (roomInGame.tileInfo[originPos.x, originPos.y + 1] == (int)TileType.Wall)
return 'd';
else
return 'u';
}
/// <summary>
/// Check if it is out of the room or not.
/// </summary>
......@@ -103,7 +179,10 @@ public class TileManager : MonoBehaviour
//int concept = room.roomConcept;
int concept = room.roomConcept % 2;
RoomInGame roomInGame = room.roomInGame;
Tilemap roomTileMap = roomInGame.transform.Find("wall").GetComponent<Tilemap>();
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>();
CheckAllTiles(roomInGame);
for(int y = 0; y < 24; y++)
{
......@@ -111,15 +190,32 @@ public class TileManager : MonoBehaviour
yield return null;*/
for(int x = 0; x < 24; x++)
{
if (roomInGame.tileInfo[x, y])
if (roomInGame.tileInfo[x, y] == (int)TileType.Wall)
{
string tileName = CheckWallQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(-1, 1)).ToString() +
CheckWallQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(1, 1)).ToString() +
CheckWallQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(-1, -1)).ToString() +
CheckWallQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(1, -1)).ToString();
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)
{
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)
{
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)
{
string tileName = CheckQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(-1, 1)).ToString() +
CheckQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(1, 1)).ToString() +
CheckQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(-1, -1)).ToString() +
CheckQuarterTile(roomInGame, new Vector2Int(x, y), new Vector2Int(1, -1)).ToString();
//Debug.Log(tileName);
if(tilesDistributed[stage, concept].ContainsKey(tileName))
roomTileMap.SetTile(new Vector3Int(x, y, 0), tilesDistributed[stage, concept][tileName]);
string tileName = CheckRopeTile(roomInGame, new Vector2Int(x, y)).ToString();
if (spikeTilesDistributed[stage, concept].ContainsKey(tileName))
spikeTileMap.SetTile(new Vector3Int(x, y, 0), spikeTilesDistributed[stage, concept][tileName]);
}
}
}
......@@ -138,6 +234,37 @@ public class TileManager : MonoBehaviour
StartCoroutine(SetAllTiles(tetrimino.rooms[i]));
}
}
}
void Awake()
{
for (int i = 0; i < 5; i++)
for (int j = 0; j < 4; j++)
{
wallTilesDistributed[i, j] = new Dictionary<string, TileBase>();
platformTilesDistributed[i, j] = new Dictionary<string, TileBase>();
ropeTilesDistributed[i, j] = new Dictionary<string, TileBase>();
spikeTilesDistributed[i, j] = new Dictionary<string, TileBase>();
}
string tileName;
for (int i = 0; i < allWallTiles.Length; i++)
{
tileName = allWallTiles[i].name;
wallTilesDistributed[int.Parse(tileName.Substring(0, 1)) - 1, int.Parse(tileName.Substring(1, 1)) - 1].Add(tileName.Substring(2), allWallTiles[i]);
}
for (int i = 0; i < allPlatformTiles.Length; i++)
{
tileName = allPlatformTiles[i].name;
platformTilesDistributed[int.Parse(tileName.Substring(0, 1)) - 1, int.Parse(tileName.Substring(1, 1)) - 1].Add(tileName.Substring(10), allPlatformTiles[i]);
}
for (int i = 0; i < allRopeTiles.Length; i++)
{
tileName = allRopeTiles[i].name;
ropeTilesDistributed[int.Parse(tileName.Substring(0, 1)) - 1, int.Parse(tileName.Substring(1, 1)) - 1].Add(tileName.Substring(6), allRopeTiles[i]);
}
for (int i = 0; i < allSpikeTiles.Length; i++)
{
tileName = allSpikeTiles[i].name;
spikeTilesDistributed[int.Parse(tileName.Substring(0, 1)) - 1, int.Parse(tileName.Substring(1, 1)) - 1].Add(tileName.Substring(7), allSpikeTiles[i]);
}
}
}
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