Merge pull request 'DDD-32 게임 플로우 매니저 및 씬 매니저 구현' (#4) from global_data_system into develop

Reviewed-on: #4
Reviewed-by: Jeonghyeon <jeonghyeon@capers.co.kr>
This commit is contained in:
iwnc2020 2025-07-14 02:04:57 +00:00
commit 762140ed6e
51 changed files with 1137 additions and 368 deletions

View File

@ -106,6 +106,7 @@ MonoBehaviour:
- Atlas
- Sprite
- So
- Scene
m_SchemaTemplates: []
m_GroupTemplateObjects:
- {fileID: 11400000, guid: f804fe78e7005554f9ba60273aade35b, type: 2}

View File

@ -10,11 +10,29 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
m_Name: GoogleSheetSprite_Group
m_Name: Group
m_EditorClassIdentifier:
m_GroupName: GoogleSheetSprite_Group
m_GroupName: Group
m_GUID: 30e7f67fe9aaa7849a34c9b6e2bc53ae
m_SerializeEntries:
- m_GUID: 2eb88deceda8c443db7ec557aaef30af
m_Address: Entry
m_ReadOnly: 0
m_SerializedLabels:
- Scene
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: a60e7a432b7eb65419f3942f4f422fb4
m_Address: Voyage
m_ReadOnly: 0
m_SerializedLabels:
- Scene
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: de073d0136201ac4cbb36dbeb4b76fb2
m_Address: Restaurant
m_ReadOnly: 0
m_SerializedLabels:
- Scene
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: e15933f76da90e742866563b5cd9e45f
m_Address: Gold
m_ReadOnly: 0

View File

@ -10,7 +10,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
m_Name: GoogleSheetSprite_Group_BundledAssetGroupSchema
m_Name: Group_BundledAssetGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: 5329bd0c1faf253408343429c6a99b39, type: 2}
m_InternalBundleIdMode: 1

View File

@ -10,7 +10,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
m_Name: GoogleSheetSprite_Group_ContentUpdateGroupSchema
m_Name: Group_ContentUpdateGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: 5329bd0c1faf253408343429c6a99b39, type: 2}
m_StaticContent: 0

View File

@ -15,7 +15,7 @@ MonoBehaviour:
rulesEnabled: 1
allowGroupCreation: 1
rules:
- path: Assets/_Datas/Addressables/(?<category>[^/]+)/(?<asset>.*)\.spriteatlasv2
- path: Assets/_DDD/_Addressables/(?<category>[^/]+)/(?<asset>.*)\.spriteatlasv2
matchType: 1
groupName:
groupTemplate: {fileID: 11400000, guid: f804fe78e7005554f9ba60273aade35b, type: 2}
@ -26,7 +26,7 @@ MonoBehaviour:
LabelMode: 1
simplified: 0
addressReplacement: ${asset}
- path: Assets/_Datas/Addressables/(?<category>[^/]+)/(?<asset>.*)\.prefab
- path: Assets/_DDD/_Addressables/(?<category>[^/]+)/(?<asset>.*)\.prefab
matchType: 1
groupName:
groupTemplate: {fileID: 11400000, guid: f804fe78e7005554f9ba60273aade35b, type: 2}
@ -37,7 +37,7 @@ MonoBehaviour:
LabelMode: 1
simplified: 0
addressReplacement: ${asset}
- path: Assets/_Datas/Addressables/(?<category>[^/]+)/(?<asset>.*)\.png
- path: Assets/_DDD/_Addressables/(?<category>[^/]+)/(?<asset>.*)\.png
matchType: 1
groupName:
groupTemplate: {fileID: 11400000, guid: f804fe78e7005554f9ba60273aade35b, type: 2}
@ -48,7 +48,7 @@ MonoBehaviour:
LabelMode: 1
simplified: 0
addressReplacement: ${asset}
- path: Assets/_Datas/Addressables/(?<category>[^/]+)/(?<asset>.*)\.asset
- path: Assets/_DDD/_Addressables/(?<category>[^/]+)/(?<asset>.*)\.asset
matchType: 1
groupName:
groupTemplate: {fileID: 11400000, guid: f804fe78e7005554f9ba60273aade35b, type: 2}
@ -59,3 +59,14 @@ MonoBehaviour:
LabelMode: 1
simplified: 0
addressReplacement: ${asset}
- path: Assets/_DDD/_Addressables/(?<category>[^/]+)/(?<asset>.*)\.unity
matchType: 1
groupName:
groupTemplate: {fileID: 11400000, guid: f804fe78e7005554f9ba60273aade35b, type: 2}
groupTemplateApplicationMode: 0
labelRefs: []
dynamicLabels:
- Scene
LabelMode: 1
simplified: 0
addressReplacement: ${asset}

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1726182683, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
m_Name: AOTGenerationConfig
m_EditorClassIdentifier:
automateBeforeBuilds: 0
deleteDllAfterBuilds: 1
AutomateForAllAOTPlatforms: 1
automateForPlatforms: 0900000014000000
supportSerializedTypes: []

View File

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

View File

@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 772478971, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
m_Name: ColorPaletteManager
m_EditorClassIdentifier:
colorPalettes:
- name: Country
showAlpha: 0
colors:
- {r: 0.776, g: 0.651, b: 0.349, a: 1}
- {r: 0.863, g: 0.761, b: 0.631, a: 1}
- {r: 0.91, g: 0.831, b: 0.686, a: 1}
- {r: 0.961, g: 0.902, b: 0.788, a: 1}
- {r: 0.753, g: 0.714, b: 0.667, a: 1}
- {r: 0.478, g: 0.573, b: 0.431, a: 1}
- {r: 0.314, g: 0.427, b: 0.31, a: 1}
- {r: 0.596, g: 0.345, b: 0.235, a: 1}
- {r: 0.545, g: 0.329, b: 0.318, a: 1}
- {r: 0.647, g: 0.204, b: 0.227, a: 1}
- {r: 0.435, g: 0.161, b: 0.063, a: 1}
- {r: 0.357, g: 0.333, b: 0.278, a: 1}
- {r: 0.976, g: 0.98, b: 0.961, a: 1}
- {r: 0.165, g: 0.271, b: 0.11, a: 1}
- name: Beach
showAlpha: 0
colors:
- {r: 0.996, g: 0.906, b: 0.459, a: 1}
- {r: 0.314, g: 0.592, b: 0.035, a: 1}
- {r: 0.486, g: 0.953, b: 0.875, a: 1}
- {r: 0.996, g: 0.82, b: 0.212, a: 1}
- {r: 1, g: 0.769, b: 0.165, a: 1}
- {r: 0.804, g: 0.835, b: 0.753, a: 1}
- {r: 1, g: 0.769, b: 0.165, a: 1}
- {r: 1, g: 0.702, b: 0.063, a: 1}
- {r: 1, g: 0.898, b: 0.569, a: 1}
- name: Fall
showAlpha: 0
colors:
- {r: 0.82, g: 0.722, b: 0.318, a: 1}
- {r: 0.537, g: 0.192, b: 0.153, a: 1}
- {r: 0.996, g: 0.812, b: 0.012, a: 1}
- {r: 1, g: 0.431, b: 0.02, a: 1}
- {r: 0.937, g: 0.267, b: 0.094, a: 1}
- {r: 0.42, g: 0.212, b: 0.18, a: 1}
- {r: 0.992, g: 0.651, b: 0.004, a: 1}
- {r: 0.89, g: 0.353, b: 0.086, a: 1}
- {r: 1, g: 0.443, b: 0.004, a: 1}
- {r: 0.682, g: 0.275, b: 0.137, a: 1}
- {r: 0.306, g: 0.231, b: 0.114, a: 1}
- {r: 0.384, g: 0.416, b: 0.082, a: 1}
- {r: 0.165, g: 0.157, b: 0.008, a: 1}
- {r: 0.906, g: 0.635, b: 0.227, a: 1}
- {r: 0.82, g: 0.722, b: 0.318, a: 1}
- {r: 0.745, g: 0.435, b: 0.031, a: 1}
- {r: 0.765, g: 0.682, b: 0.569, a: 1}
- {r: 0.18, g: 0.149, b: 0.075, a: 1}
- {r: 0.702, g: 0.451, b: 0.059, a: 1}
- name: Passion
showAlpha: 0
colors:
- {r: 0.925, g: 0.682, b: 0.624, a: 1}
- {r: 0.188, g: 0.114, b: 0.224, a: 1}
- {r: 0.349, g: 0.11, b: 0.231, a: 1}
- {r: 0.435, g: 0.267, b: 0.357, a: 1}
- name: Sepia
showAlpha: 0
colors:
- {r: 0.353, g: 0.098, b: 0.02, a: 1}
- {r: 0.663, g: 0.188, b: 0.114, a: 1}
- {r: 0.906, g: 0.643, b: 0.082, a: 1}
- {r: 0.996, g: 0.839, b: 0.322, a: 1}
- {r: 0.486, g: 0.392, b: 0.02, a: 1}
- {r: 0.294, g: 0.235, b: 0.012, a: 1}
- name: Floral
showAlpha: 0
colors:
- {r: 0.855, g: 0.518, b: 0.412, a: 1}
- {r: 0.827, g: 0.294, b: 0.333, a: 1}
- {r: 0.737, g: 0.118, b: 0.208, a: 1}
- {r: 0.549, g: 0.149, b: 0.235, a: 1}
- {r: 0.949, g: 0.925, b: 0.784, a: 1}
- {r: 0.945, g: 0.882, b: 0.69, a: 1}
- {r: 0.871, g: 0.812, b: 0.698, a: 1}
- {r: 0.4, g: 0.196, b: 0.243, a: 1}
- {r: 0.271, g: 0.157, b: 0.227, a: 1}
- name: Underwater
showAlpha: 0
colors:
- {r: 0.663, g: 0.416, b: 0.733, a: 1}
- {r: 0.2, g: 0.6, b: 0.698, a: 1}
- {r: 0.11, g: 0.49, b: 0.698, a: 1}
- {r: 0.439, g: 0.627, b: 0.227, a: 1}
- {r: 0, g: 0.357, b: 0.604, a: 1}
- {r: 0.067, g: 0.271, b: 0.353, a: 1}
- name: Breeze
showAlpha: 0
colors:
- {r: 0.706, g: 1, b: 0, a: 1}
- {r: 0.651, g: 1, b: 0.404, a: 1}
- {r: 0.122, g: 1, b: 0.514, a: 1}
- {r: 0.216, g: 0.894, b: 0.961, a: 1}
- {r: 0.4, g: 1, b: 0.882, a: 1}
- {r: 0.027, g: 0.792, b: 0.8, a: 1}
- name: Clovers
showAlpha: 0
colors:
- {r: 0.431, g: 0.549, b: 0.102, a: 1}
- {r: 0.671, g: 0.714, b: 0.071, a: 1}
- {r: 0.969, g: 0.949, b: 0.831, a: 1}
- {r: 0.886, g: 0.902, b: 0.702, a: 1}
- {r: 0.753, g: 0.824, b: 0.627, a: 1}
- {r: 0.404, g: 0.6, b: 0.4, a: 1}
- name: Tropical
showAlpha: 0
colors:
- {r: 0.953, g: 0.647, b: 0.804, a: 1}
- {r: 0.965, g: 0.741, b: 0.871, a: 1}
- {r: 0.949, g: 0.549, b: 0.643, a: 1}
- {r: 0.992, g: 0.659, b: 0.498, a: 1}
- {r: 0.976, g: 0.792, b: 0.729, a: 1}
- {r: 0.984, g: 0.855, b: 0.725, a: 1}
- {r: 0.259, g: 0.882, b: 0.663, a: 1}
- {r: 0.349, g: 0.753, b: 0.78, a: 1}
- {r: 0.725, g: 0.976, b: 0.91, a: 1}
- {r: 0.647, g: 0.745, b: 0.957, a: 1}
- {r: 0.725, g: 0.863, b: 0.973, a: 1}
- {r: 0.89, g: 0.945, b: 0.996, a: 1}

View File

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

View File

@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 188390376, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
m_Name: ImportSettingsConfig
m_EditorClassIdentifier:
automateBeforeBuild: 1

View File

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

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 1549551891, guid: 74721b9f0af448f5ae2e91102a1a5edd, type: 3}
m_Name: GlobalSerializationConfig
m_EditorClassIdentifier:
HideSerializationCautionaryMessage: 0
HideSerializationCautionaryMessage: 1
HidePrefabCautionaryMessage: 0
HideOdinSerializeAttributeWarningMessages: 0
HideNonSerializedShowInInspectorWarningMessages: 0

View File

@ -1,16 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!612988286 &1
SpriteAtlasAsset:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
serializedVersion: 2
m_MasterAtlas: {fileID: 0}
m_ImporterData:
packables:
- {fileID: 21300000, guid: 189d780f1507008429f2cdd1a2b4c9e8, type: 3}
m_IsVariant: 0
m_ScriptablePacker: {fileID: 0}

View File

@ -1,30 +0,0 @@
fileFormatVersion: 2
guid: 12a5a31425daa2547a044994a3198578
SpriteAtlasImporter:
externalObjects: {}
textureSettings:
serializedVersion: 2
anisoLevel: 0
compressionQuality: 0
maxTextureSize: 0
textureCompression: 0
filterMode: 1
generateMipMaps: 0
readable: 0
crunchedCompression: 0
sRGB: 1
platformSettings: []
packingSettings:
serializedVersion: 2
padding: 4
blockOffset: 0
allowAlphaSplitting: 0
enableRotation: 0
enableTightPacking: 0
enableAlphaDilation: 0
secondaryTextureSettings: {}
variantMultiplier: 1
bindAsDefault: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 85a3e9842123aff43beeb3ada811ef2d
guid: 19c202afbafbdec47b3f6dd33bc3727c
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -128,7 +128,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1415192492}
- component: {fileID: 1415192491}
- component: {fileID: 1415192493}
m_Layer: 0
m_Name: GameManager
m_TagString: Untagged
@ -136,20 +136,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1415192491
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1415192490}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 965655bbd1b2f224196ab3275ea13a57, type: 3}
m_Name:
m_EditorClassIdentifier:
_persistent: 1
_managerDefinitionSo: {fileID: 11400000, guid: d8346bac7a0fdab419cca3193df2ca34, type: 2}
--- !u!4 &1415192492
Transform:
m_ObjectHideFlags: 0
@ -165,6 +151,20 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1415192493
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1415192490}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 965655bbd1b2f224196ab3275ea13a57, type: 3}
m_Name:
m_EditorClassIdentifier:
_persistent: 1
_managerDefinitionSo: {fileID: 11400000, guid: cdd4d1e802374914a8c7f82a8da65bd4, type: 2}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0

View File

@ -0,0 +1,385 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &203844586
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 203844589}
- component: {fileID: 203844588}
- component: {fileID: 203844587}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &203844587
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 203844586}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0
--- !u!108 &203844588
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 203844586}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &203844589
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 203844586}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &961739749
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 961739753}
- component: {fileID: 961739752}
- component: {fileID: 961739751}
- component: {fileID: 961739750}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &961739750
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 961739749}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
m_Quality: 3
m_FrameInfluence: 0.1
m_JitterScale: 1
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0
--- !u!81 &961739751
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 961739749}
m_Enabled: 1
--- !u!20 &961739752
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 961739749}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &961739753
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 961739749}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 961739753}
- {fileID: 203844589}

View File

@ -1,6 +1,5 @@
fileFormatVersion: 2
guid: 1dfca4dd026496c4693f1dccfc3a8033
folderAsset: yes
guid: a60e7a432b7eb65419f3942f4f422fb4
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,7 +1,12 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using UnityEditor.AddressableAssets;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
namespace DDD
{
@ -24,15 +29,70 @@ public async void PostInit()
}
}
public static async Awaitable<T> LoadAsset<T>(string key) where T : UnityEngine.Object
public static async Task<T> LoadAsset<T>(string key) where T : UnityEngine.Object
{
var handle = Addressables.LoadAssetAsync<T>(key);
await handle.Task;
if (handle.Status == AsyncOperationStatus.Succeeded)
return handle.Result;
Debug.LogError($"Addressable load failed : {key}");
return null;
}
public static async Task<T> LoadAsset<T>(AssetReference reference) where T : UnityEngine.Object
{
if (reference == null)
{
Debug.LogError("Null AssetReference");
return null;
}
var handle = reference.LoadAssetAsync<T>();
await handle.Task;
if (handle.Status == AsyncOperationStatus.Succeeded)
return handle.Result;
Debug.LogError($"AssetReference load failed: {reference.RuntimeKey}");
return null;
}
public static async Task<SceneInstance> LoadScene(string key, LoadSceneMode mode = LoadSceneMode.Additive)
{
var handle = Addressables.LoadSceneAsync(key, mode);
await handle.Task;
if (handle.Status == AsyncOperationStatus.Succeeded)
return handle.Result;
Debug.LogError($"Scene load failed: {key}");
return default;
}
public static async Task UnloadScene(SceneInstance sceneInstance)
{
var handle = Addressables.UnloadSceneAsync(sceneInstance);
await handle.Task;
}
public static bool HasLabel(string addressKey, string label)
{
#if UNITY_EDITOR
var settings = AddressableAssetSettingsDefaultObject.Settings;
if (settings == null) return false;
var entry = settings.groups
.SelectMany(g => g.entries)
.FirstOrDefault(e => e.address == addressKey);
if (entry == null) return false;
return entry.labels.Contains(label);
#else
return true;
#endif
}
}
}

View File

@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3551048425852892906
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1415126601904257055}
- component: {fileID: 2098954470556750352}
m_Layer: 0
m_Name: AssetManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1415126601904257055
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3551048425852892906}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2098954470556750352
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3551048425852892906}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 38667042b7dae844b813b6d15d63ec65, type: 3}
m_Name:
m_EditorClassIdentifier:
_persistent: 1

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 95aca5968f190f24eab9bd122ab241bc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,25 +0,0 @@
using System.Linq;
#if UNITY_EDITOR
using UnityEditor.AddressableAssets;
#endif
public class AddressableManager : Singleton<AddressableManager>
{
public static bool HasLabel(string addressKey, string label)
{
#if UNITY_EDITOR
var settings = AddressableAssetSettingsDefaultObject.Settings;
if (settings == null) return false;
var entry = settings.groups
.SelectMany(g => g.entries)
.FirstOrDefault(e => e.address == addressKey);
if (entry == null) return false;
return entry.labels.Contains(label);
#else
return true;
#endif
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 85a4615ed6971ef4aa78a1b01d8a8be3

View File

@ -9,6 +9,57 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 0}
m_Script: {fileID: 11500000, guid: 5a7982cc52e32e14c916a8144c5184b0, type: 3}
m_Name: GameFlowAssetsSo
m_EditorClassIdentifier: Assembly-CSharp:DDD:GameFlowAssetsSo
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: FlowItems
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[DDD.GameFlowState, Assembly-CSharp],[System.Collections.Generic.List`1[[System.String,
mscorlib]], mscorlib]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.EnumEqualityComparer`1[[DDD.GameFlowState,
Assembly-CSharp]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name: FlowAssets
Entry: 7
Data: 2|System.Collections.Generic.Dictionary`2[[DDD.GameFlowState, Assembly-CSharp],[System.Collections.Generic.List`1[[UnityEngine.AddressableAssets.AssetReference,
Unity.Addressables]], mscorlib]], mscorlib
- Name: comparer
Entry: 9
Data: 1
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,15 @@
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
using UnityEngine.AddressableAssets;
namespace DDD
{
// Dictionary를 인스펙터창에서 저장하려면 Odin의 SerializedScriptableObject을 상속받아야 함
[CreateAssetMenu(fileName = "GameFlowAssetsSo", menuName = "GameFlow/GameFlowAssetsSo")]
public class GameFlowAssetsSo : SerializedScriptableObject
{
public Dictionary<GameFlowState, List<string>> FlowItems = new();
public Dictionary<GameFlowState, List<AssetReference>> FlowAssets = new();
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5a7982cc52e32e14c916a8144c5184b0

View File

@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b72ae9e11a346704aaca5a0651dbc47e, type: 3}
m_Name: GameFlowDataSo
m_EditorClassIdentifier:
CurrentGameState: 0

View File

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

View File

@ -0,0 +1,10 @@
using UnityEngine;
namespace DDD
{
[CreateAssetMenu(fileName = "GameFlowDataSo", menuName = "GameFlow/GameFlowDataSo")]
public class GameFlowDataSo : ScriptableObject
{
public GameFlowState CurrentGameState;
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b72ae9e11a346704aaca5a0651dbc47e

View File

@ -1,98 +1,64 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
namespace DDD
{
public enum GameFlowState
{
None = 0,
ReadyForRestaurant = 1,
RunRestaurant = 2,
SettlementRestaurant = 3,
}
public class GameFlowDataSo : ScriptableObject
{
public GameFlowState CurrentGameState;
}
[CreateAssetMenu(fileName = "GameFlowAssetsSo", menuName = "GameFlow/GameFlowAssetsSo")]
public class GameFlowAssetsSo : ScriptableObject
{
[ShowInInspector]
public Dictionary<GameFlowState, List<string>> FlowItems = new();
[ShowInInspector]
public Dictionary<GameFlowState, List<AssetReference>> FlowAssets = new();
}
[CreateAssetMenu(fileName = "GameFlowSceneMappingSo", menuName = "GameFlow/GameFlowSceneMappingSo")]
public class GameFlowSceneMappingSo : ScriptableObject
{
[ShowInInspector]
public Dictionary<GameFlowState, Scene> FlowToSceneMapping = new();
}
}
public class GameFlowManager : Singleton<GameFlowManager>, IManager
{
private GameFlowDataSo _gameFlowDataSo;
public GameFlowDataSo GameFlowDataSo;
public GameFlowAssetsSo GameFlowAssetsSo;
public GameFlowSceneMappingSo GameFlowSceneMappingSo;
public void Init()
{
_gameFlowDataSo = ScriptableObject.CreateInstance<GameFlowDataSo>();
}
public void PostInit()
public async void PostInit()
{
SceneManager.Instance.OnSceneChanged += OnFlowSceneOpened;
if (IsGameStarted() == false)
try
{
ChangeFlow(GameFlowState.ReadyForRestaurant);
if (IsGameStarted() == false)
{
await ChangeFlow(GameFlowState.ReadyForRestaurant);
}
}
catch (Exception e)
{
Debug.LogWarning(e);
}
}
public bool IsGameStarted() => _gameFlowDataSo.CurrentGameState != GameFlowState.None;
public bool IsGameStarted() => GameFlowDataSo.CurrentGameState != GameFlowState.None;
protected override void Awake()
public async Task ChangeFlow(GameFlowState newFlowState)
{
base.Awake();
}
private void Start()
{
}
private bool CanChangeFlow(GameFlowState newFlowState)
{
return true;
}
public void ChangeFlow(GameFlowState newFlowState)
{
StartCoroutine(ChangeFlowCoroutine(newFlowState));
}
private IEnumerator ChangeFlowCoroutine(GameFlowState newFlowState)
{
if (CanChangeFlow(newFlowState) == false)
if (!CanChangeFlow(newFlowState))
{
Debug.LogError("Can't change flow");
yield break;
return;
}
EndCurrentFlow();
await ReadyNewFlow(newFlowState);
}
private bool CanChangeFlow(GameFlowState newFlowState)
{
return true;
}
public void EndCurrentFlow()
@ -100,32 +66,31 @@ public void EndCurrentFlow()
}
public IEnumerator ReadyNewFlow(GameFlowState newFlowState)
public async Task ReadyNewFlow(GameFlowState newFlowState)
{
OpenFlowScene(newFlowState);
// Ready Assets
if (GameFlowAssetsSo.FlowItems.ContainsKey(newFlowState))
if (GameFlowAssetsSo.FlowItems.TryGetValue(newFlowState, out var stringKeys))
{
List<string> Items = GameFlowAssetsSo.FlowItems[newFlowState];
// Addressables.LoadAssetsAsync(Items, null);
// TODO : 여러 에셋 로드하고, 콜백 받을때까지 기다리기
// Wait
}
List<Task<UnityEngine.Object>> loadTasks = new(stringKeys.Count);
foreach (var key in stringKeys)
{
loadTasks.Add(AssetManager.LoadAsset<UnityEngine.Object>(key));
}
if (GameFlowAssetsSo.FlowAssets.ContainsKey(newFlowState))
{
//List<AssetReference> Assets = GameFlowAssets.FlowItems[newFlowState];
// Addressables.LoadAssetsAsync(Assets, )
// TODO : 여러 에셋 로드하고, 콜백 받을때까지 기다리기
// Wait
await Task.WhenAll(loadTasks);
}
// Ready Scene
GetFlowScene(newFlowState, out var flowScene);
yield return new WaitUntil(() => _currentScene == flowScene );
if (GameFlowAssetsSo.FlowAssets.TryGetValue(newFlowState, out var assetRefs))
{
List<Task<UnityEngine.Object>> loadTasks = new(assetRefs.Count);
foreach (var assetRef in assetRefs)
{
loadTasks.Add(AssetManager.LoadAsset<UnityEngine.Object>(assetRef));
}
await Task.WhenAll(loadTasks);
}
OpenFlowScene(newFlowState);
StartFlow();
}
@ -134,7 +99,7 @@ public void OpenFlowScene(GameFlowState newFlowState)
{
if (GetFlowScene(newFlowState, out var sceneToLoad))
{
SceneManager.Instance.RequestSceneLoad(sceneToLoad);
SceneManager.Instance.ActivateScene(sceneToLoad);
}
else
{
@ -142,20 +107,9 @@ public void OpenFlowScene(GameFlowState newFlowState)
}
}
private Scene _currentScene;
public void OnFlowSceneOpened(Scene newScene)
public bool GetFlowScene(GameFlowState flowState, out SceneType sceneType)
{
_currentScene = newScene;
}
public bool GetFlowScene(GameFlowState flowState, out Scene scene)
{
if (GameFlowSceneMappingSo.FlowToSceneMapping.TryGetValue(flowState, out scene))
{
return true;
}
return false;
return GameFlowSceneMappingSo.FlowToSceneMapping.TryGetValue(flowState, out sceneType);
}
public void StartFlow()

View File

@ -45,10 +45,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_persistent: 1
GameFlowSceneMapping: {fileID: 0}
FlowAsset:
m_AssetGUID: e15933f76da90e742866563b5cd9e45f
m_SubObjectName:
m_SubObjectType:
m_SubObjectGUID:
m_EditorAssetChanged: 1
GameFlowDataSo: {fileID: 11400000, guid: 80e88e1d5a0875148b96f6eeccd024d0, type: 2}
GameFlowAssetsSo: {fileID: 11400000, guid: 4fca93ffece40ff48973532398011d84, type: 2}
GameFlowSceneMappingSo: {fileID: 11400000, guid: 11d1c2609268ac14fa627958ee097fac, type: 2}

View File

@ -9,6 +9,89 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 0}
m_Script: {fileID: 11500000, guid: 72f94df4b8d880240809c43494de628b, type: 3}
m_Name: GameFlowSceneMappingSo
m_EditorClassIdentifier: Assembly-CSharp:DDD:GameFlowSceneMappingSo
m_EditorClassIdentifier:
serializationData:
SerializedFormat: 2
SerializedBytes:
ReferencedUnityObjects: []
SerializedBytesString:
Prefab: {fileID: 0}
PrefabModificationsReferencedUnityObjects: []
PrefabModifications: []
SerializationNodes:
- Name: FlowToSceneMapping
Entry: 7
Data: 0|System.Collections.Generic.Dictionary`2[[DDD.GameFlowState, Assembly-CSharp],[DDD.SceneType,
Assembly-CSharp]], mscorlib
- Name: comparer
Entry: 7
Data: 1|System.Collections.Generic.EnumEqualityComparer`1[[DDD.GameFlowState,
Assembly-CSharp]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 12
Data: 4
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 0
- Name: $v
Entry: 3
Data: 0
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 1
- Name: $v
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 2
- Name: $v
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 3
Data: 3
- Name: $v
Entry: 3
Data: 1
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:

View File

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
namespace DDD
{
// Dictionary를 인스펙터창에서 저장하려면 Odin의 SerializedScriptableObject을 상속받아야 함
[CreateAssetMenu(fileName = "GameFlowSceneMappingSo", menuName = "GameFlow/GameFlowSceneMappingSo")]
public class GameFlowSceneMappingSo : SerializedScriptableObject
{
public Dictionary<GameFlowState, SceneType> FlowToSceneMapping = new();
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 72f94df4b8d880240809c43494de628b

View File

@ -3,12 +3,6 @@
namespace DDD
{
[CreateAssetMenu(fileName = "ManagerDefinitionSo", menuName = "GameFramework/ManagerDefinitionSo")]
public class ManagerDefinitionSo : ScriptableObject
{
public List<Singleton> ManagerClasses;
}
public class GameManager : Singleton<GameManager>
{
[SerializeField]
@ -16,10 +10,15 @@ public class GameManager : Singleton<GameManager>
private List<Singleton> _managerInstances;
protected override void OnAwake()
protected void Start()
{
base.OnAwake();
if (_managerDefinitionSo == null)
{
Debug.LogError("_managerDefinitionSo");
return;
}
// Entry Scene에서 뭘 해야할까?
// 매니저 초기화
@ -28,6 +27,8 @@ protected override void OnAwake()
foreach (var managerObject in _managerDefinitionSo.ManagerClasses)
{
var managerInstance = Instantiate(managerObject);
managerInstance.name = managerObject.name;
_managerInstances.Add(managerInstance);
if (managerInstance is IManager manager)
{

View File

@ -9,10 +9,11 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 0}
m_Script: {fileID: 11500000, guid: 4743c803a9907d64394dafe4e4237c2a, type: 3}
m_Name: ManagerDefinitionSo
m_EditorClassIdentifier: Assembly-CSharp:DDD:ManagerDefinitionSo
m_EditorClassIdentifier:
ManagerClasses:
- {fileID: 7665229218737596710, guid: 71b177c2a18314c588da30429451666a, type: 3}
- {fileID: 6471498998539637564, guid: fa2ad62c75b1549f09597e47ed5f7cfb, type: 3}
- {fileID: 2098954470556750352, guid: 95aca5968f190f24eab9bd122ab241bc, type: 3}
- {fileID: 4889131746858770208, guid: d90fdb17f0162334daadc6fc93e9a0e3, type: 3}
- {fileID: 6471498998539637564, guid: fa2ad62c75b1549f09597e47ed5f7cfb, type: 3}
- {fileID: 7665229218737596710, guid: 71b177c2a18314c588da30429451666a, type: 3}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d8346bac7a0fdab419cca3193df2ca34
guid: cdd4d1e802374914a8c7f82a8da65bd4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@ -0,0 +1,11 @@
using System.Collections.Generic;
using UnityEngine;
namespace DDD
{
[CreateAssetMenu(fileName = "ManagerDefinitionSo", menuName = "GameFramework/ManagerDefinitionSo")]
public class ManagerDefinitionSo : ScriptableObject
{
public List<Singleton> ManagerClasses;
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4743c803a9907d64394dafe4e4237c2a

View File

@ -1,163 +1,118 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DG.Tweening;
using Sirenix.OdinInspector;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.ResourceManagement.ResourceProviders;
namespace DDD
{
public enum SceneType
{
Title = 0,
Entry = 0,
Restaurant = 1,
Voyage = 2
}
public static class SceneTypeExtensions
{
public static string ToSceneName(this SceneType sceneType)
{
return sceneType switch
{
SceneType.Title => "00.Title",
SceneType.Restaurant => "01.Restaurant",
_ => throw new ArgumentOutOfRangeException(nameof(sceneType), sceneType, null)
};
}
}
public class SceneDefinition : ScriptableObject
{
}
public class SceneManager : Singleton<SceneManager>, IManager
{
public Action<Scene> OnSceneChanged;
private Dictionary<SceneType, SceneInstance> _loadedScenes;
private SceneInstance _currentSceneInstance;
public Action<SceneInstance> OnSceneChanged;
public void Init()
{
// Load Scene Data
Array sceneTypeArray = Enum.GetValues(typeof(SceneType));
_loadedScenes = new Dictionary<SceneType, SceneInstance>(sceneTypeArray.Length);
}
public void PostInit()
public async void PostInit()
{
}
public void RequestSceneLoad(Scene sceneToLoad)
{
//TODO
print($"Scene Load : {sceneToLoad.name}");
// onSceneTransitionStarted.Broadcast()
}
[Title("연출")]
[SerializeField]
private float _fadeTime = 0.5f;
public SceneType CurrentSceneType { get; private set; }
private GameObject _fadePanel;
private CanvasGroup _fadeCanvasGroup;
private Tween _fadeIn;
private Tween _fadeOut;
// protected override void OnAwake()
// {
// base.OnAwake();
//
// _fadePanel = transform.Find("Canvas/FadePanel").gameObject;
// _fadeCanvasGroup = _fadePanel.GetComponent<CanvasGroup>();
// }
// private void Start()
// {
// CurrentSceneType = SceneType.Title;
//
// _fadePanel.SetActive(false);
// _fadeCanvasGroup.alpha = 0f;
//
// _fadeIn = _fadeCanvasGroup.DOFade(1f, _fadeTime).SetUpdate(true).SetAutoKill(false).Pause();
// _fadeOut = _fadeCanvasGroup.DOFade(0f, _fadeTime).SetUpdate(true).SetAutoKill(false).Pause();
// }
// private void OnDestroy()
// {
// _fadeIn?.Kill();
// _fadeOut?.Kill();
// }
public async Task FadeIn()
{
if (_fadeIn == null)
{
Debug.LogWarning("FadeIn 트윈이 설정되지 않았습니다.");
return;
}
_fadePanel.SetActive(true);
_fadeIn.Restart();
await _fadeIn.AsyncWaitForCompletion();
}
public async Task FadeOut()
{
if (_fadeOut == null)
{
Debug.LogWarning("FadeOut 트윈이 설정되지 않았습니다.");
return;
}
_fadeOut.Restart();
await _fadeOut.AsyncWaitForCompletion();
_fadePanel.SetActive(false);
}
public async Task ChangeScene(SceneType sceneType)
{
string changeSceneName;
try
{
changeSceneName = sceneType.ToSceneName();
foreach (SceneType sceneType in Enum.GetValues(typeof(SceneType)))
{
if (sceneType == SceneType.Entry) continue;
var sceneInstance = await AssetManager.LoadScene(sceneType.ToString());
if (sceneInstance.Scene.IsValid())
{
_loadedScenes[sceneType] = sceneInstance;
foreach (var go in sceneInstance.Scene.GetRootGameObjects())
{
go.SetActive(false);
}
}
}
}
catch (ArgumentOutOfRangeException e)
catch (Exception e)
{
Debug.LogError($"[GameManager] 정의되지 않은 SceneType: {sceneType} - {e.Message}");
return;
Debug.LogWarning($"Scene preload failed\n{e}");
}
await FadeIn();
AsyncOperation loadSceneAsync = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(changeSceneName);
while (loadSceneAsync is { isDone: false })
await Task.Yield();
// 씬 로딩 후 초기화 작업
CameraManager.Instance.ChangeScene(sceneType);
InputManager.Instance.ChangeScene(sceneType);
CurrentSceneType = sceneType;
await Task.Delay(1000);
await FadeOut();
Debug.Log($"{changeSceneName} 씬으로 전환 완료");
}
public void ChangeSceneByIndex(int index)
public SceneInstance GetSceneInstance(SceneType sceneType) => _loadedScenes[sceneType];
public async Task PreloadSceneAsync(SceneType sceneType)
{
var sceneType = (SceneType)index;
_ = ChangeScene(sceneType);
if (_loadedScenes.ContainsKey(sceneType))
return;
string key = sceneType.ToString();
SceneInstance sceneInstance = await AssetManager.LoadScene(key);
if (sceneInstance.Scene.IsValid())
{
_loadedScenes[sceneType] = sceneInstance;
foreach (var root in sceneInstance.Scene.GetRootGameObjects())
{
root.SetActive(false);
}
}
else
{
Debug.LogError($"[SceneManager] Failed to preload scene: {sceneType}");
}
}
public void ActivateScene(SceneType sceneType)
{
if (_loadedScenes.TryGetValue(sceneType, out var sceneInstance))
{
foreach (var root in sceneInstance.Scene.GetRootGameObjects())
{
root.SetActive(true);
}
UnityEngine.SceneManagement.SceneManager.SetActiveScene(sceneInstance.Scene);
_currentSceneInstance = sceneInstance;
}
else
{
Debug.LogError($"[SceneManager] Scene not loaded: {sceneType}");
}
}
public void DeactivateScene(SceneType sceneType)
{
if (_loadedScenes.TryGetValue(sceneType, out var sceneInstance))
{
foreach (var root in sceneInstance.Scene.GetRootGameObjects())
{
root.SetActive(false);
}
}
}
public async Task UnloadSceneAsync(SceneType sceneType)
{
if (_loadedScenes.TryGetValue(sceneType, out var sceneInstance))
{
await AssetManager.UnloadScene(GetSceneInstance(sceneType));
}
}
}
}

View File

@ -680,7 +680,7 @@ private async Task<bool> InternalCreateGoogleSheetSoAsync()
if (string.IsNullOrEmpty(spriteKey))
continue;
if (!AddressableManager.HasLabel(spriteKey, "Sprite"))
if (!AssetManager.HasLabel(spriteKey, "Sprite"))
{
Debug.LogWarning($"[GoogleSheetManager] Sprite 라벨 없음: {spriteKey}");
continue;

View File

@ -31,20 +31,20 @@ protected override void OnAwake()
_currentPlayerInput = GetComponent<PlayerInput>();
}
public void ChangeScene(SceneType sceneType)
{
switch (sceneType)
{
case SceneType.Title:
SwitchCurrentActionMap(InputActionMaps.Ui);
break;
case SceneType.Restaurant:
SwitchCurrentActionMap(InputActionMaps.Restaurant);
break;
default:
throw new System.Exception("Invalid scene name");
}
}
// public void ChangeScene(SceneType sceneType)
// {
// switch (sceneType)
// {
// case SceneType.Title:
// SwitchCurrentActionMap(InputActionMaps.Ui);
// break;
// case SceneType.Restaurant:
// SwitchCurrentActionMap(InputActionMaps.Restaurant);
// break;
// default:
// throw new System.Exception("Invalid scene name");
// }
// }
private bool IsNullCurrentPlayerInput()
{

View File

@ -1,7 +1,6 @@
using JetBrains.Annotations;
using UnityEngine;
[DefaultExecutionOrder(-2)]
public abstract class Singleton<T> : Singleton where T : MonoBehaviour
{
#region Fields

View File

@ -9,7 +9,7 @@ EditorBuildSettings:
path: Assets/_DDD/_Scenes/00.Title.unity
guid: 99c9720ab356a0642a771bea13969a05
- enabled: 1
path: Assets/_DDD/_Scenes/01.Restaurant.unity
path: Assets/_DDD/_Addressables/Scenes/Restaurant.unity
guid: de073d0136201ac4cbb36dbeb4b76fb2
m_configObjects:
addressableimportsettingslist: {fileID: 11400000, guid: ded0fd49318dc504f89f2396f0d12d69, type: 2}