Skip to content

Commit

Permalink
Merge pull request #203 from 2024FALL-SWPP/bugfix/Anomaly22
Browse files Browse the repository at this point in the history
이상현상 22 플레이어가 아래로 떨어졌을 때 안 죽는 버그 해결
  • Loading branch information
seozzi authored Dec 15, 2024
2 parents 8350cc0 + 3beefdb commit e76d9e3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions 302/Assets/Scripts/SpecificAnomalyManager/Anomaly22Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,24 @@ void Start()
floorTiles = new List<Transform>(floorTilesArray);
platformTile = FindPlatformTile();

StartCoroutine(AddBoxColliders()); // 타일 각각에 Collider 추가
StartCoroutine(DestroyFloorBoxCollider()); // Floor Parent의 통일된 Collider 제거
StartCoroutine(StartWithDelay());
}

private IEnumerator StartWithDelay()
{
yield return new WaitForSeconds(5f);

StartCoroutine(InitializeCollidersAndDestroyParentCollider());
StartCoroutine(CountSeconds());
StartCoroutine(TriggerPlatformFall());
StartCoroutine(TriggerRandomTileShakeAndFallWithInterval());
}

private IEnumerator InitializeCollidersAndDestroyParentCollider()
{
yield return StartCoroutine(AddBoxColliders());
yield return StartCoroutine(DestroyFloorBoxCollider());
}

private Transform FindPlatformTile()
{
Expand Down Expand Up @@ -98,7 +109,7 @@ private IEnumerator AddBoxColliders()
Vector3 originalCenter = tileCollider.center;

tileCollider.size = new Vector3(originalSize.x, originalSize.y, originalSize.z * 20); // Change Y value to 3
tileCollider.center = new Vector3(originalCenter.x, originalCenter.y, originalCenter.z - originalSize.z * 20); // Adjust center for correct positioning
tileCollider.center = new Vector3(originalCenter.x, originalCenter.y, originalCenter.z - originalSize.z * 10); // Adjust center for correct positioning
}
}
yield return null;
Expand All @@ -116,7 +127,7 @@ private IEnumerator CountSeconds()
void Update()
{
// 아래로 떨어졌는지 확인해서 Game Over 처리
if (playerController.transform.position.y < -1f && !isPlayerDead && false)
if (playerController.transform.position.y < -1f && !isPlayerDead)
{
playerController.Sleep();
isPlayerDead = true;
Expand Down

0 comments on commit e76d9e3

Please sign in to comment.