-
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.
게임 스타팅 씬 완성했습니다. 기존 기획과 달라진 부분이 있는데, 스테이지 0에서 1로 넘어갈 때 추가 이펙트를 넣기에는 코드 통일성 해치고 별도 함수를 호출해야 해서, 그냥 일관되게 잠드는 이펙트를 사용했습니다... 나머지는 기획과 동일하게, start버튼 누르면 화면 깜빡깜빡 애니메이션 재생되고, 0스테이지로 이동하며, 이후부터는 실패해도 1스테이지로 돌아옵니다. 제 로컬 머신 성능때문에 defaultgamescene로드가 좀 느리게 되는데, 다른 분들 확인 바랍니다!
- 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