본문 바로가기
Study/Unity

[미니 프로젝트] 02. 크레딧, 시작하기, 이어하기 버튼

by 죈트 2025. 1. 21.

크레딧 버튼 구현

  • 크레딧 버튼 생성
  • 크레딧 버튼에 나타날 UI 생성
  • 코드로 연결
public class CreditBtn : MonoBehaviour
{
    public GameObject Credit;

    // Credit 진입 버튼
    public void Btn_Credit()
    {
        Debug.Log("CreditBtn");
        Credit.SetActive(true);
    }

    // Credit 탈출 버튼
    public void Btn_CreditExit()
    {
        Debug.Log("CreditExitBtn");
        Credit.SetActive(false);
    }
}

 

 

시작하기, 이어하기 버튼

  • 각 버튼 생성
  • 전환 될 Scene 지정
  • 코드로 연결
public class StartBtn : MonoBehaviour
{
    // 시작하기 버튼
    public void Btn_Start()
    {
        Debug.Log("StartBtn");
        SceneManager.LoadScene("MainScene");
    }
}
public class ContinueBtn : MonoBehaviour
{
    // 이어하기 버튼
    public void Btn_Continue()
    {
        Debug.Log("ContinueBtn");
        SceneManager.LoadScene("ChoiceScene");
    }
}

 

 

Button과 Text로만 단순하게 구성된 화면이었는데, 멋진 팀원들의 손길 덕분에 이제 화면이 훨씬 더 아름다워졌다.