-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chaehwan/anomaly01
- Loading branch information
Showing
8 changed files
with
52,681 additions
and
1,151 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
using UnityEngine; | ||
using System; | ||
|
||
public class StartingCameraController : MonoBehaviour | ||
{ | ||
[SerializeField] private ScreenFader screenFader; // ScreenFader 컴포넌트 | ||
[SerializeField] private float fadeOutDuration = 2f; // 화면 어두워지는 시간 | ||
[SerializeField] private float fadeInDuration = 2f; // 화면 밝아지는 시간 | ||
[SerializeField] private float waitBeforeFadeIn = 0.5f; // 화면이 어두워진 상태에서 대기 시간 | ||
|
||
public event Action OnFadeComplete; // 페이드 완료 시 이벤트 | ||
private bool isFading = false; | ||
|
||
void Start() | ||
{ | ||
if (screenFader == null) | ||
{ | ||
screenFader = FindObjectOfType<ScreenFader>(); | ||
if (screenFader == null) | ||
{ | ||
Debug.LogError("ScreenFader component not found in the scene!"); | ||
return; | ||
} | ||
} | ||
} | ||
|
||
public void PlayFadeSequence() | ||
{ | ||
if (!isFading) | ||
{ | ||
StartCoroutine(FadeSequence()); | ||
} | ||
} | ||
|
||
public void PlayFadeOut() | ||
{ | ||
if (!isFading) | ||
{ | ||
StartCoroutine(FadeOut()); | ||
} | ||
} | ||
|
||
public void PlayFadeIn() | ||
{ | ||
if (!isFading) | ||
{ | ||
StartCoroutine(FadeIn()); | ||
} | ||
} | ||
|
||
private System.Collections.IEnumerator FadeSequence() | ||
{ | ||
isFading = true; | ||
|
||
// Fade Out | ||
yield return FadeOut(); | ||
|
||
// 대기 | ||
yield return new WaitForSeconds(waitBeforeFadeIn); | ||
|
||
// Fade In | ||
yield return FadeIn(); | ||
|
||
yield return FadeOut(); | ||
yield return new WaitForSeconds(waitBeforeFadeIn); | ||
yield return FadeIn(); | ||
yield return FadeOut(); | ||
|
||
isFading = false; | ||
|
||
// 애니메이션 완료 신호 전송 | ||
OnFadeComplete?.Invoke(); | ||
} | ||
|
||
private System.Collections.IEnumerator FadeOut() | ||
{ | ||
isFading = true; | ||
screenFader.StartFade(1f, fadeOutDuration); | ||
yield return new WaitForSeconds(fadeOutDuration); | ||
} | ||
|
||
private System.Collections.IEnumerator FadeIn() | ||
{ | ||
screenFader.StartFade(0f, fadeInDuration); | ||
yield return new WaitForSeconds(fadeInDuration); | ||
isFading = false; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters