Skip to content

Commit

Permalink
Merge branch 'main' into chaehwan/tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Prown0 committed Dec 2, 2024
2 parents e005d52 + 27ad8d2 commit 842cbc4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7578491145889696626}
m_LocalRotation: {x: 0, y: 0.01745245, z: 0, w: 0.99984777}
m_LocalRotation: {x: 0, y: 0.06975647, z: 0, w: 0.9975641}
m_LocalPosition: {x: -13.900001, y: 0, z: 0.5}
m_LocalScale: {x: 1, y: 1, z: 2.7}
m_ConstrainProportionsScale: 0
Expand All @@ -200,7 +200,7 @@ Transform:
- {fileID: 2253782372444049494}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 2, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 8, z: 0}
--- !u!65 &-5532419088782107508
BoxCollider:
m_ObjectHideFlags: 0
Expand Down
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
15 changes: 14 additions & 1 deletion 302/Assets/Scripts/SpecificAnomalyManager/Anomaly8_micsound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class Anomaly8_micsound : InteractableObject, IInteractable
public float maxVolumeDistance = 5f; // Distance at which the audio reaches max volume
public float startDistance = 30f; // Maximum distance where the audio starts being audible
public float fadeOutDuration = 2f; // Duration for the fade-out effect after interaction
public float audioStartDelay = 5f; // Delay in seconds before the audio starts playing

private bool isAudioActive = false;

private void Start()
{
Expand All @@ -29,14 +32,24 @@ private void Start()
if (audioSource != null)
{
audioSource.loop = true; // Ensure the sound loops continuously until interaction
audioSource.Play(); // Start playing audio immediately
audioSource.volume = 0f;
StartCoroutine(DelayedAudiosStart());
}
else
{
Debug.LogError("AudioSource component is missing on Anomaly8_micsound.");
}
}

private IEnumerator DelayedAudiosStart()
{
yield return new WaitForSeconds(audioStartDelay);
isAudioActive = true;
audioSource.Play();
Debug.Log("Audio playback started after delay.");

}

private void Update()
{
if (playerTransform == null || audioSource == null) return;
Expand Down

0 comments on commit 842cbc4

Please sign in to comment.