Commit 0cc78875 authored by abpo11's avatar abpo11

플랫폼 알고리즘 수정, 플레이어만 정상적으로 플랫폼에 영향받음. 플레이어의 방 좌표 수정, 문 위에 서있을때 방 좌표가 바뀌지 않고, 방...

플랫폼 알고리즘 수정, 플레이어만 정상적으로 플랫폼에 영향받음. 플레이어의 방 좌표 수정, 문 위에 서있을때 방 좌표가 바뀌지 않고, 방 사이 플랫폼에 서있을때 정상적으로 아랫방으로 인식함
parent 92356b8c
...@@ -21,7 +21,7 @@ GameObject: ...@@ -21,7 +21,7 @@ GameObject:
- component: {fileID: 4921126351507724} - component: {fileID: 4921126351507724}
- component: {fileID: 212944448011839934} - component: {fileID: 212944448011839934}
m_Layer: 0 m_Layer: 0
m_Name: Fog m_Name: fog
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
......
...@@ -19,7 +19,7 @@ public class Player : MonoBehaviour { ...@@ -19,7 +19,7 @@ public class Player : MonoBehaviour {
// Update is called once per frame // Update is called once per frame
void Update () { void Update () {
tx = (int)(transform.position.x / 24f); tx = (int)(transform.position.x / 24f);
ty = (int)(transform.position.y / 24f); ty = (int)((transform.position.y-0.9f) / 24f);
if ((ttx != tx || tty != ty) && MapManager.isRoomFalling != true) if ((ttx != tx || tty != ty) && MapManager.isRoomFalling != true)
{ {
MapManager.currentRoom = MapManager.mapGrid[tx, ty]; MapManager.currentRoom = MapManager.mapGrid[tx, ty];
......
...@@ -219,10 +219,10 @@ public class PlayerController : MonoBehaviour ...@@ -219,10 +219,10 @@ public class PlayerController : MonoBehaviour
{ {
if (element.name == "platform") if (element.name == "platform")
{ {
element.enabled = false; Physics2D.IgnoreCollision(element, transform.GetComponent<Collider2D>(),true);
yield return new WaitForSeconds(0.3f); yield return new WaitForSeconds(0.3f);
while(isInRope) yield return new WaitForSeconds(0.1f); while(isInRope) yield return new WaitForSeconds(0.1f);
element.enabled = true; Physics2D.IgnoreCollision(element, transform.GetComponent<Collider2D>(), false);
isDownPlatform = false; isDownPlatform = false;
} }
} }
......
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