Commit af70e9f8 authored by 18손재민's avatar 18손재민

이제 플레이어가 방 문을 지나칠 때 문이 완전히 닫히기 전까지는 아주 잠깐동안 못움직임

parent 9b987038
...@@ -21,15 +21,6 @@ AnimationClip: ...@@ -21,15 +21,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -116,15 +107,6 @@ AnimationClip: ...@@ -116,15 +107,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
......
...@@ -21,15 +21,6 @@ AnimationClip: ...@@ -21,15 +21,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -116,15 +107,6 @@ AnimationClip: ...@@ -116,15 +107,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
......
...@@ -21,15 +21,6 @@ AnimationClip: ...@@ -21,15 +21,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -116,15 +107,6 @@ AnimationClip: ...@@ -116,15 +107,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
......
...@@ -21,15 +21,6 @@ AnimationClip: ...@@ -21,15 +21,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -116,15 +107,6 @@ AnimationClip: ...@@ -116,15 +107,6 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
......
...@@ -80,7 +80,7 @@ public class PlayerController : MonoBehaviour ...@@ -80,7 +80,7 @@ public class PlayerController : MonoBehaviour
{ {
isGrounded = IsGrounded(); isGrounded = IsGrounded();
if (GameManager.gameState == GameState.Ingame) if (GameManager.gameState == GameState.Ingame && MapManager.isDoorClosing != true)
{ {
anim.SetBool("rope", isInRope); anim.SetBool("rope", isInRope);
anim.SetBool("run", isDashing); anim.SetBool("run", isDashing);
......
...@@ -35,7 +35,7 @@ public class Door : MonoBehaviour { ...@@ -35,7 +35,7 @@ public class Door : MonoBehaviour {
enteredPosition = 2; enteredPosition = 2;
break; break;
case 1: case 1:
if (collision.transform.position.x < GetComponent<PolygonCollider2D>().transform.position.x) if (collision.transform.position.x < GetComponent<PolygonCollider2D>().transform.position.x + 0.6f)
return; return;
enteredPosition = 3; enteredPosition = 3;
break; break;
...@@ -50,9 +50,10 @@ public class Door : MonoBehaviour { ...@@ -50,9 +50,10 @@ public class Door : MonoBehaviour {
enteredPosition = 1; enteredPosition = 1;
break; break;
} }
MapManager.isDoorClosing = true;
MapManager mapManager = GameObject.Find("MapManager").GetComponent<MapManager>(); MapManager mapManager = GameObject.Find("MapManager").GetComponent<MapManager>();
Room room = MapManager.currentRoom; Room room = MapManager.currentRoom;
StartCoroutine(mapManager.GetComponent<MapManager>().RoomFadeOut(room)); StartCoroutine(mapManager.RoomFadeOut(room));
if(room.specialRoomType == RoomType.Normal) if(room.specialRoomType == RoomType.Normal)
room.GetComponent<SpriteRenderer>().sprite = mapManager.roomsSpritesDistributed[room.stage][(int)RoomSpriteType.Normal1 + room.roomConcept]; room.GetComponent<SpriteRenderer>().sprite = mapManager.roomsSpritesDistributed[room.stage][(int)RoomSpriteType.Normal1 + room.roomConcept];
else else
......
...@@ -4,6 +4,8 @@ using UnityEngine; ...@@ -4,6 +4,8 @@ using UnityEngine;
public class MapManager : MonoBehaviour { public class MapManager : MonoBehaviour {
public static bool isDoorClosing = false;
/* /*
* variables * variables
* */ * */
...@@ -280,13 +282,14 @@ public class MapManager : MonoBehaviour { ...@@ -280,13 +282,14 @@ public class MapManager : MonoBehaviour {
int doorCloseCounter = 0; int doorCloseCounter = 0;
int roomDestroyCounter = 0; int roomDestroyCounter = 0;
int row = leftPress.row; int row = leftPress.row;
float collapseRate = 0;
while (Time.time - initialCollapseTime < collapseTime) while (Time.time - initialCollapseTime < collapseTime)
{ {
yield return new WaitForSeconds(0.01f); yield return new WaitForSeconds(0.01f);
float collapseRate = (Time.time - initialCollapseTime) / collapseTime; collapseRate = (Time.time - initialCollapseTime) / collapseTime;
leftPress.transform.localScale = new Vector3(collapseRate * 20, 1, 1); leftPress.transform.localScale = new Vector3(collapseRate * 20, 1, 1);
rightPress.transform.localScale = new Vector3(-collapseRate * 20, 1, 1); rightPress.transform.localScale = new Vector3(-collapseRate * 20, 1, 1);
if(collapseRate - doorCloseCounter * 0.2f > (float)1 / 12) if (collapseRate - doorCloseCounter * 0.2f > (float)1 / 12)
{ {
mapGrid[doorCloseCounter, row].CloseDoor("Up", false); mapGrid[doorCloseCounter, row].CloseDoor("Up", false);
mapGrid[doorCloseCounter, row].CloseDoor("Down", false); mapGrid[doorCloseCounter, row].CloseDoor("Down", false);
...@@ -793,6 +796,7 @@ public class MapManager : MonoBehaviour { ...@@ -793,6 +796,7 @@ public class MapManager : MonoBehaviour {
room.leftTetrisDoor.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0); room.leftTetrisDoor.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0);
room.rightTetrisDoor.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0); room.rightTetrisDoor.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0);
room.fog.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0); room.fog.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0);
isDoorClosing = false;
} }
/// <summary> /// <summary>
/// Make room fade out. /// Make room fade out.
......
...@@ -285,8 +285,9 @@ public class Room : MonoBehaviour ...@@ -285,8 +285,9 @@ public class Room : MonoBehaviour
fog = Instantiate(GameObject.Find("MapManager").GetComponent<MapManager>().clearedFog, fogPosition, Quaternion.identity, transform); fog = Instantiate(GameObject.Find("MapManager").GetComponent<MapManager>().clearedFog, fogPosition, Quaternion.identity, transform);
fog.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0); fog.GetComponent<SpriteRenderer>().color = new Color(1, 1, 1, 0);
isRoomCleared = true; isRoomCleared = true;
if (specialRoomType == RoomType.Boss)
MapManager.currentStage += 1;
} }
//Need to make extra works. //Need to make extra works.
} }
} }
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