2026-04-17 로딩바 완성

This commit is contained in:
skrwns304@gmail.com
2026-04-17 01:19:02 +09:00
parent 55e644f34e
commit 25e7b5bf4d
14 changed files with 202 additions and 13 deletions

Binary file not shown.

View File

@@ -1,4 +1,5 @@
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -7,6 +8,7 @@ public class SceneLoadManager : MonoBehaviour
{
public static SceneLoadManager Instance;
[SerializeField] private GameObject _loadingRoot;
[SerializeField] private Camera _loadingCam;
[SerializeField] private Transform _loadingCamTargetTransform;
[SerializeField] private LoadingScreen _loadingScreen;
@@ -30,6 +32,15 @@ private void Start()
SceneManager.sceneLoaded += OnSceneLoaded;
}
private void Update()
{
if(_loadingCamTargetTransform != null)
{
_loadingCam.transform.position = _loadingCamTargetTransform.position;
_loadingCam.transform.rotation = _loadingCamTargetTransform.rotation;
}
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
// 씬이 로드될 때마다
@@ -56,13 +67,16 @@ public async Awaitable FadeLoadingCanvas(bool isOut,float fadeTime)
public async Task SetSceneLoadingActive(bool isActive,float alphaTime)
{
if (isActive)
_loadingRoot.SetActive(true);
if(alphaTime > 0f)
if (alphaTime > 0f)
{
await FadeLoadingCanvas(!isActive,alphaTime);
}
_loadingScreen.gameObject.SetActive(isActive);
if (!isActive)
_loadingRoot.SetActive(false);
}
public void SetSceneLoadingActive(bool isActive)
@@ -90,7 +104,7 @@ private async Awaitable SceneChange(string sceneName)
{
try
{
await SetSceneLoadingActive(true,2f);
await SetSceneLoadingActive(true,1f);
AsyncOperation op = SceneManager.LoadSceneAsync(sceneName);
@@ -133,7 +147,7 @@ private async Awaitable SceneChange(string sceneName)
//VR용 로직
//트래킹이 중단되면 안되기 때문에 카메라를 유지해야 한다
_loadingCamTargetTransform = Camera.main.transform; // 새로운 씬의 메인카메라를 따라가게끔 설정
await SetSceneLoadingActive(false,2f);
await SetSceneLoadingActive(false,1f);
//-------------------------------------------------------------------------------
Debug.Log("씬 전환됨");

View File

@@ -5,7 +5,6 @@
public class LoadingScreen : MonoBehaviour
{
public Image LoadingImage;
public Image BackgroundImage;
public TextMeshProUGUI LoadingTextMeshProUGUI;
public CanvasGroup LoadingScreenCanvasGroup;

Binary file not shown.

View File

@@ -0,0 +1,21 @@
fileFormatVersion: 2
guid: 1122d0bdca1197e41946cde96c59a45c
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontNames:
- Hakgyoansim TTeokbokki B
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,21 @@
fileFormatVersion: 2
guid: 569e44948aacc0c4f9a5f52b0f2fe46f
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontNames:
- Hakgyoansim Tteokbokki OTF B
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,112 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Hakgyoansim_TteokbokkiB SDF Material Outline
m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- UNDERLAY_ON
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Cube:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: -4589865433819228246, guid: eb4302500bb26d946b283d1dbd1bd726, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
- _BevelClamp: 0
- _BevelOffset: 0
- _BevelRoundness: 0
- _BevelWidth: 0
- _BumpFace: 0
- _BumpOutline: 0
- _ColorMask: 15
- _CullMode: 0
- _Diffuse: 0.5
- _FaceDilate: 0
- _FaceUVSpeedX: 0
- _FaceUVSpeedY: 0
- _GlowInner: 0.05
- _GlowOffset: 0
- _GlowOuter: 0.348
- _GlowPower: 0.177
- _GradientScale: 5
- _LightAngle: 3.1416
- _MaskSoftnessX: 0
- _MaskSoftnessY: 0
- _OutlineSoftness: 0
- _OutlineUVSpeedX: 0
- _OutlineUVSpeedY: 0
- _OutlineWidth: 1
- _PerspectiveFilter: 0.875
- _Reflectivity: 10
- _ScaleRatioA: 0.67368424
- _ScaleRatioB: 0.65
- _ScaleRatioC: 0.65
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0
- _Sharpness: 0
- _SpecularPower: 2
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _TextureHeight: 8192
- _TextureWidth: 8192
- _UnderlayDilate: 0.1
- _UnderlayOffsetX: 0
- _UnderlayOffsetY: 0
- _UnderlaySoftness: 0
- _VertexOffsetX: 0
- _VertexOffsetY: 0
- _WeightBold: 0.75
- _WeightNormal: 0
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _GlowColor: {r: 0, g: 0, b: 0, a: 1}
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9b02dbd4bc30d604994cd8d19751f565
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eb4302500bb26d946b283d1dbd1bd726
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant: