-
Notifications
You must be signed in to change notification settings - Fork 2
explain SceneMove
Yoo Hyeokjin edited this page Jun 13, 2023
·
1 revision
- 각 Scene으로 이동할 수 있도록 하는 Code의 모음이다.
- Scene간 이동 코드를 사용하려면 다음과 같은 코드가 필요하다
using UnityEngine.SceneManagement;
public void ToBack()
{
SceneManager.LoadScene("Main");
}
public void ToAchievements()
{
SceneManager.LoadScene("Achievements");
}
public void ToCharacterSelection()
{
SceneManager.LoadScene("CharacterSelection");
}
public void ToCollection()
{
SceneManager.LoadScene("Collection");
}
public void ToOption()
{
SceneManager.LoadScene("Option");
}
public void ToPowerUp()
{
SceneManager.LoadScene("PowerUp");
}
public void ToStage()
{
SceneManager.LoadScene("StageSelection");
}
public void ToStart()
{
SceneManager.LoadScene("InGame");
}
public void ToResultScene()
{
SceneManager.LoadScene("GameResult");
}
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneMove : MonoBehaviour
{
public void ToAchievements()
{
SceneManager.LoadScene("Achievements");
}
public void ToBack()
{
SceneManager.LoadScene("Main");
}
public void ToCharacterSelection()
{
SceneManager.LoadScene("CharacterSelection");
}
public void ToCollection()
{
SceneManager.LoadScene("Collection");
}
public void ToOption()
{
SceneManager.LoadScene("Option");
}
public void ToPowerUp()
{
SceneManager.LoadScene("PowerUp");
}
public void ToStage()
{
SceneManager.LoadScene("StageSelection");
}
public void ToStart()
{
SceneManager.LoadScene("InGame");
}
public void ToResultScene()
{
SceneManager.LoadScene("GameResult");
}
public void OnClickExit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}