Commit 8509e01b authored by abpo11's avatar abpo11

플레이어 방 좌표 및 생명석 하이라이트 고침

parent f3bc76e6
...@@ -14,13 +14,13 @@ public class Player : MonoBehaviour { ...@@ -14,13 +14,13 @@ public class Player : MonoBehaviour {
// Use this for initialization // Use this for initialization
void Start () { void Start () {
ttx = (int)(transform.position.x / 24f); ttx = (int)(transform.position.x / 24f);
tty = (int)(transform.position.y / 24f); tty = (int)(transform.position.y-0.9f / 24f);
} }
// 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.tempRoom = MapManager.mapGrid[tx, ty]; MapManager.tempRoom = MapManager.mapGrid[tx, ty];
......
...@@ -96,11 +96,20 @@ public class PlayerController : MonoBehaviour ...@@ -96,11 +96,20 @@ public class PlayerController : MonoBehaviour
rb.gravityScale = rbAttackGravityScale; rb.gravityScale = rbAttackGravityScale;
return; return;
} }
if (GetItemRay() == false && lastDropItem!=null) if (GetItemRay() == false )
{
if (lastDropItem != null)
{ {
lastDropItem.HighlightSwitch(false); lastDropItem.HighlightSwitch(false);
lastDropItem = null; lastDropItem = null;
} }
if (lastLifeStone != null)
{
lastLifeStone.HighlightSwitch(false);
lastLifeStone = null;
}
}
if (interaction != 1f) interactionCoolDown = true; if (interaction != 1f) interactionCoolDown = true;
if (lastDropItem!=null && interaction == 1f &&interactionCoolDown) if (lastDropItem!=null && interaction == 1f &&interactionCoolDown)
{ {
...@@ -288,7 +297,6 @@ public class PlayerController : MonoBehaviour ...@@ -288,7 +297,6 @@ public class PlayerController : MonoBehaviour
if (lastLifeStone != null) if (lastLifeStone != null)
{ {
lastLifeStone.HighlightSwitch(false); lastLifeStone.HighlightSwitch(false);
} }
lastLifeStone = stoneTemp; lastLifeStone = stoneTemp;
stoneTemp.HighlightSwitch(true); stoneTemp.HighlightSwitch(true);
...@@ -300,7 +308,6 @@ public class PlayerController : MonoBehaviour ...@@ -300,7 +308,6 @@ public class PlayerController : MonoBehaviour
if (lastDropItem != null) if (lastDropItem != null)
{ {
lastDropItem.HighlightSwitch(false); lastDropItem.HighlightSwitch(false);
} }
lastDropItem = temp; lastDropItem = temp;
temp.HighlightSwitch(true); temp.HighlightSwitch(true);
...@@ -338,7 +345,7 @@ public class PlayerController : MonoBehaviour ...@@ -338,7 +345,7 @@ public class PlayerController : MonoBehaviour
} }
}*/ }*/
return hit1.collider != null ; return hit1.collider != null;
} }
bool IsInRope() // Is player in rope? bool IsInRope() // Is player in rope?
{ {
......
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