Skip to content

Commit

Permalink
이상현상 22 타일 한 번에 떨어지는 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
seozzi committed Dec 16, 2024
1 parent b659c6e commit 1282aa6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.

This file was deleted.

This file was deleted.

16 changes: 5 additions & 11 deletions 302/Assets/Scripts/SpecificAnomalyManager/Anomaly22Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class Anomaly22Manager : MonoBehaviour
private GameObject floor; // 모든 타일들의 Parent
private GameManager gameManager;
private PlayerController playerController;
public float interval = 1f;
public float totalSeconds = 30f;
private bool isPlayerDead = false;

Expand Down Expand Up @@ -66,15 +65,8 @@ private IEnumerator TriggerPlatformFall()
{
if (platformTile != null)
{
Anomaly22_tile tileScript = platformTile.GetComponent<Anomaly22_tile>();
if (tileScript == null)
{

tileScript = platformTile.gameObject.AddComponent<Anomaly22_tile>();
tileScript.shakeSound = shakeSound;
} else {

}
Anomaly22_tile tileScript = platformTile.gameObject.AddComponent<Anomaly22_tile>();
tileScript.shakeSound = shakeSound;

tileScript.TriggerShakeAndFall();
yield return new WaitForSeconds(2f);
Expand Down Expand Up @@ -145,6 +137,8 @@ private IEnumerator TriggerRandomTileShakeAndFallWithInterval()
Transform selectedTile = floorTiles[randomIndex];

Anomaly22_tile tileScript = selectedTile.GetComponent<Anomaly22_tile>();

// 이미 tileScript이 안 붙어 있는 타일만 새로 fall trigger 가능
if (tileScript == null)
{
tileScript = selectedTile.gameObject.AddComponent<Anomaly22_tile>();
Expand All @@ -153,7 +147,7 @@ private IEnumerator TriggerRandomTileShakeAndFallWithInterval()
tileScript.TriggerShakeAndFall();
}

yield return new WaitForSeconds(interval);
yield return new WaitForSeconds(0.5f);
}

if (!isPlayerDead) // totalSeconds가 다 지날 때까지 생존 시
Expand Down

0 comments on commit 1282aa6

Please sign in to comment.