Skip to content

Commit

Permalink
Anomaly24 Dealy added
Browse files Browse the repository at this point in the history
지연시간 추가했고, 슬리프 하고 있을 때에는 stage clear상태 건들지 않도록 코드 조금 수정했습니다!
  • Loading branch information
psy020529 committed Dec 2, 2024
1 parent c48a14a commit 21cecee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ AudioSource:
serializedVersion: 4
OutputAudioMixerGroup: {fileID: -5523475028350657157, guid: 015e5e0494ba69d49a8752e353c68200, type: 2}
m_audioClip: {fileID: 8300000, guid: a2d444c66d9eecc4aab7c2aa628f4cae, type: 3}
m_PlayOnAwake: 1
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Expand Down Expand Up @@ -143,7 +143,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
duration: 10
blurEffectPrefab: {fileID: 5749295200580246030, guid: 49570e3cac9d9fd48a18034aa29f20b8, type: 3}
--- !u!1001 &1226223968390349156
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[RequireComponent(typeof(AudioSource))]
public class Anomaly24_luciddream : MonoBehaviour
{
[SerializeField] private float duration = 10f; // 제한 시간 10초로 설정
[SerializeField] private float duration = 30f;
private AudioSource audioSource;
private Transform mainCamera;

Expand All @@ -25,18 +25,16 @@ private IEnumerator LucidDreamSequence()
{
GameManager.Instance.SetStageClear();

yield return new WaitForSeconds(10f);

audioSource.Play();

float elapsedTime = 0f;

while (elapsedTime < duration)
{
elapsedTime += Time.deltaTime;

// 디버깅 메시지: 현재 경과 시간 표시
if (Mathf.FloorToInt(elapsedTime) % 2 == 0)
{
Debug.Log($"Elapsed Time: {elapsedTime:F2} seconds");
}

// Main Camera 바라보기
if (mainCamera != null)
{
Expand All @@ -52,8 +50,11 @@ private IEnumerator LucidDreamSequence()

yield return null;
}
if(GameManager.Instance.GetGameState() != GameManager.GameState.Sleeping)
{
GameManager.Instance.SetStageNoClear();
}

GameManager.Instance.SetStageNoClear();
var playerController = FindObjectOfType<PlayerController>();
if (playerController != null)
{
Expand Down

0 comments on commit 21cecee

Please sign in to comment.