Skip to content

Commit

Permalink
presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongho committed Dec 17, 2024
1 parent 3bf4bd0 commit fe617c2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions 302/Assets/Scenes/DefaultGameScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -43763,6 +43763,8 @@ MonoBehaviour:
checkIntersect: 0
SpecificAnomalyNum: 11
currentAnomalyInstance: {fileID: 8678062959089499939, guid: 6aadfcd777444a24180cf51012c6e89c, type: 3}
isPresentationMode: 1
presentationAnomalies: 0f00000007000000150000001e0000001a000000190000000700000008000000
--- !u!4 &1964216256
Transform:
m_ObjectHideFlags: 0
Expand Down
15 changes: 15 additions & 0 deletions 302/Assets/Scripts/AnomalyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class AnomalyManager : MonoBehaviour
public int SpecificAnomalyNum;
public GameObject currentAnomalyInstance; // 현재 활성화된 이상현상 인스턴스
// 하나의 AnomalyManager만 보장
public bool isPresentationMode = false;
[SerializeField]
private int[] presentationAnomalies = new int[] { 15, 7, 21, 30, 26, 25, 7, 8 }; // Inspector에서 설정 가능
private void Awake()
{
if (Instance == null)
Expand All @@ -37,6 +40,17 @@ private void Awake()
private void GenerateAnomalyList()
{
anomalyList.Clear();

if (isPresentationMode)
{
// 프레젠테이션 모드일 때는 미리 정의된 배열 사용
for (int i = 0; i < AnomalyCount; i++)
{
anomalyList.Add(presentationAnomalies[i % presentationAnomalies.Length]);
}
}
else
{
HashSet<int> uniqueNumbers = new HashSet<int>();
bool hasHighAnomaly = false;

Expand Down Expand Up @@ -70,6 +84,7 @@ private void GenerateAnomalyList()
int highAnomaly = random.Next(21, 31);
anomalyList[randomIndex] = highAnomaly;
}
}
Debug.Log($"[AnomalyManager] Generated Anomaly List: {string.Join(", ", anomalyList)}");
CheckAndInstantiateAnomaly();
}
Expand Down
2 changes: 1 addition & 1 deletion 302/Assets/Scripts/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private IEnumerator WakeUpAnimation()

public void GameOver()
{
GameManager.Instance.SetStageNoClear();
GameManager.Instance.SetStageClear();
if (!isAnimating) // isDead 체크 제거
{
StartCoroutine(DeathAnimation());
Expand Down
5 changes: 3 additions & 2 deletions 302/Assets/Scripts/SpecificAnomalyManager/Anomaly7_Gun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class Anomaly7_Gun : InteractableObject
private Transform playerCameraTransform;
private PlayerController playerController;
private Camera playerCamera;
private int gunValue = 1;

// 플래시 효과 관련 변수
private Material flashMaterial;
Expand Down Expand Up @@ -119,8 +120,8 @@ private IEnumerator RussianRouletteSequence()
audioSource.PlayOneShot(chamberSpinSound);
yield return new WaitForSeconds(1f);

bool survive = Random.value > 0.2f;

bool survive = (gunValue==1);
gunValue = 0;
if (!survive)
{
audioSource.PlayOneShot(gunShotSound);
Expand Down

0 comments on commit fe617c2

Please sign in to comment.