폴더 위치 변경
This commit is contained in:
parent
077f87cbfd
commit
3965578a39
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "InputSystem_Actions",
|
"name": "DDD_InputSystem",
|
||||||
"maps": [
|
"maps": [
|
||||||
{
|
{
|
||||||
"name": "Tycoon",
|
"name": "Tycoon",
|
8
Assets/_Datas/02.Scripts/Controllers.meta
Normal file
8
Assets/_Datas/02.Scripts/Controllers.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bfa59972eae73774abfbd334a141be1c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
61
Assets/_Datas/02.Scripts/Controllers/GameManager.cs
Normal file
61
Assets/_Datas/02.Scripts/Controllers/GameManager.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
public enum SceneName
|
||||||
|
{
|
||||||
|
Title = 0,
|
||||||
|
Restaurant = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GameManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
private UiManager _uiManager;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
_uiManager = FindAnyObjectByType<UiManager>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void ChangeScene(SceneName sceneName)
|
||||||
|
{
|
||||||
|
string previousSceneName = SceneManager.GetActiveScene().name;
|
||||||
|
string changeSceneName;
|
||||||
|
|
||||||
|
switch (sceneName)
|
||||||
|
{
|
||||||
|
case SceneName.Title:
|
||||||
|
changeSceneName = "00.Title";
|
||||||
|
break;
|
||||||
|
case SceneName.Restaurant:
|
||||||
|
changeSceneName = "01.Restaurant";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(sceneName), sceneName, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
await _uiManager.FadeIn();
|
||||||
|
|
||||||
|
AsyncOperation loadSceneAsync = SceneManager.LoadSceneAsync(changeSceneName, LoadSceneMode.Additive);
|
||||||
|
while (loadSceneAsync is { isDone: false })
|
||||||
|
await Task.Yield();
|
||||||
|
|
||||||
|
_uiManager.ChangeScene(previousSceneName, changeSceneName);
|
||||||
|
|
||||||
|
await Task.Delay(1000);
|
||||||
|
|
||||||
|
await _uiManager.FadeOut();
|
||||||
|
|
||||||
|
Debug.Log($"씬 로드 및 전환 완료: {changeSceneName}");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ChangeSceneByIndex(int index)
|
||||||
|
{
|
||||||
|
var sceneEnum = (SceneName)index;
|
||||||
|
ChangeScene(sceneEnum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
Assets/_Datas/02.Scripts/Controllers/GameManager.cs.meta
Normal file
2
Assets/_Datas/02.Scripts/Controllers/GameManager.cs.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 965655bbd1b2f224196ab3275ea13a57
|
@ -11,7 +11,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Sirenix.OdinInspector;
|
using Sirenix.OdinInspector;
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine.AddressableAssets;
|
using UnityEngine.AddressableAssets;
|
||||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
using UnityEngine.ResourceManagement.AsyncOperations;
|
8
Assets/_Datas/02.Scripts/Utilities.meta
Normal file
8
Assets/_Datas/02.Scripts/Utilities.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3590dcd51cf8e3b40bebeacc15c44a15
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user