diff --git a/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset b/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset index 0ea95f8d3..a793b242d 100644 --- a/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset +++ b/Assets/_DDD/_Addressables/AI/Customer/Subtree/CustomerDefault.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7ca4b40dc25f4a6ff14a7cbdb2a8be04431ba958038b899fd700df86c4f9618 -size 87312 +oid sha256:277f8b3b25cfe078e4838cab1222b85e5dae0bc036cb39e5f84b6e3b3fce1cd0 +size 68048 diff --git a/Assets/_DDD/_Addressables/AI/Customer/Subtree/OrderSubtree.asset b/Assets/_DDD/_Addressables/AI/Customer/Subtree/OrderSubtree.asset index 8434d7b80..7e7bb95e0 100644 --- a/Assets/_DDD/_Addressables/AI/Customer/Subtree/OrderSubtree.asset +++ b/Assets/_DDD/_Addressables/AI/Customer/Subtree/OrderSubtree.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:817cecbbecbe8a6519225bc1d0fce376c0dfb14a240c248e3fbdc8a93f585f72 -size 20385 +oid sha256:6da8678bc90f664244b89aa26dc5c6b01c51567387ea3414b916fb27082f752b +size 16520 diff --git a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab index 80cdc789c..d16acedec 100644 --- a/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/CustomerNpc.prefab @@ -1210,9 +1210,6 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} insertIndex: -1 addedObject: {fileID: 3825874317044733320} - - targetCorrespondingSourceObject: {fileID: 7462519206451630147, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} - insertIndex: -1 - addedObject: {fileID: 1122074513716966771} m_SourcePrefab: {fileID: 100100000, guid: ceeea618d8ee23642a0e56b3f963448c, type: 3} --- !u!1 &4266090516809920735 stripped GameObject: @@ -1255,23 +1252,3 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: af69e82818254bfa9cabb2dbf9430850, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &1122074513716966771 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4266090516809920735} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 201f9e6d7ca7404baa9945950292a392, type: 3} - m_Name: - m_EditorClassIdentifier: - _interactionType: 4 - _executionParameters: - _holdTime: 0 - _displayParameters: - _messageKey: - _interactionAvailableFlows: 2 - _aiInteractionPoints: [] - autoInitialize: 1 diff --git a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab index f842662b8..bb8720305 100644 --- a/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab +++ b/Assets/_DDD/_Addressables/Prefabs/RestaurantPlayer.prefab @@ -426,7 +426,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 81e01dd8c1cc3404d805400eba1bb4ae, type: 3} m_Name: m_EditorClassIdentifier: - _availableInteractions: 5 + _availableInteractions: 7 _nearColliders: - {fileID: 0} - {fileID: 0} diff --git a/Assets/_DDD/_ScriptAssets/Prefabs/AssetManager.prefab b/Assets/_DDD/_ScriptAssets/Prefabs/AssetManager.prefab index 80b46c13c..f9da50762 100644 --- a/Assets/_DDD/_ScriptAssets/Prefabs/AssetManager.prefab +++ b/Assets/_DDD/_ScriptAssets/Prefabs/AssetManager.prefab @@ -45,3 +45,4 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _persistent: 1 + _enableDebugLog: 1 diff --git a/Assets/_DDD/_ScriptAssets/Prefabs/InventoryManager.prefab b/Assets/_DDD/_ScriptAssets/Prefabs/InventoryManager.prefab index d129e1fbd..e290e9188 100644 --- a/Assets/_DDD/_ScriptAssets/Prefabs/InventoryManager.prefab +++ b/Assets/_DDD/_ScriptAssets/Prefabs/InventoryManager.prefab @@ -45,3 +45,4 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _persistent: 1 + _inventoryTestDataSo: {fileID: 11400000, guid: 29d0dee3b70fbc44d992ea47012bc366, type: 2} diff --git a/Assets/_DDD/_ScriptAssets/So/ManagerDefinitionSo.asset b/Assets/_DDD/_ScriptAssets/So/ManagerDefinitionSo.asset index a76bc5919..198eb2519 100644 --- a/Assets/_DDD/_ScriptAssets/So/ManagerDefinitionSo.asset +++ b/Assets/_DDD/_ScriptAssets/So/ManagerDefinitionSo.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e22d6af69a361da6b510144cfed3df81e14ae58cc18093c2fed9f06553f42259 +oid sha256:b4d8b8e6ec2ca99570deababa75093849d4cfcd6af6c78fbcc857880b03c0226 size 1504 diff --git a/Assets/_DDD/_Scripts/AI/Common/IAISharedBlackboard.cs b/Assets/_DDD/_Scripts/AI/Common/IAISharedBlackboard.cs index 154eebd47..8136be741 100644 --- a/Assets/_DDD/_Scripts/AI/Common/IAISharedBlackboard.cs +++ b/Assets/_DDD/_Scripts/AI/Common/IAISharedBlackboard.cs @@ -9,7 +9,7 @@ namespace DDD /// public interface IAISharedBlackboard { - void SetCurrentInteractionTarget(GameObject targetGameObject); - GameObject GetCurrentInteractionTarget(); + void SetBlackboardGameObject(string key, GameObject inGameObject); + GameObject GetBlackboardGameObject(string key); } } diff --git a/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs b/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs index d1ab863b7..3af080ccc 100644 --- a/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs +++ b/Assets/_DDD/_Scripts/AssetManagement/AssetManager.cs @@ -1,10 +1,6 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -#if UNITY_EDITOR -using UnityEditor.AddressableAssets; -#endif using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; @@ -15,7 +11,34 @@ namespace DDD { public class AssetManager : Singleton, IManager { - private static readonly Dictionary _cachedHandles = new(); + private struct CachedAsset + { + public AsyncOperationHandle Handle; + public int ReferenceCount; + + public CachedAsset(AsyncOperationHandle handle, int count = 1) + { + Handle = handle; + ReferenceCount = count; + } + } + + private struct CachedScene + { + public AsyncOperationHandle Handle; + public int ReferenceCount; + + public CachedScene(AsyncOperationHandle handle, int count = 1) + { + Handle = handle; + ReferenceCount = count; + } + } + + [SerializeField] private bool _enableDebugLog = false; + + private readonly Dictionary _cachedAssets = new(); + private readonly Dictionary _cachedScenes = new(); protected override void OnApplicationQuit() { @@ -24,110 +47,284 @@ protected override void OnApplicationQuit() ReleaseAllCached(); } - public void PreInit() - { - - } + public void PreInit() { } public async Task Init() { await Addressables.InitializeAsync().Task; } - public void PostInit() + public void PostInit() { } + + private string GetSafeAssetName(AssetReference assetReference) { + var editorAssetName = assetReference.editorAsset.name; + if (string.IsNullOrWhiteSpace(editorAssetName) == false) return editorAssetName; + return assetReference.ToString(); } - - public static async Task LoadAsset(string key) where T : UnityEngine.Object + + public async Task LoadAssetAsync(AssetReference assetReference) where T : Object { - if (_cachedHandles.TryGetValue(key, out var handle)) + var guidKey = assetReference.AssetGUID; + + if (_cachedAssets.TryGetValue(guidKey, out var cachedAsset)) { - if (handle.IsValid() && handle.Result is T result) + if (cachedAsset.Handle.IsValid() && cachedAsset.Handle.Result is T result) + { + cachedAsset.ReferenceCount++; + _cachedAssets[guidKey] = cachedAsset; + + if (_enableDebugLog) Debug.Log($"[AssetManager] 에셋 참조 카운트 증가: {GetSafeAssetName(assetReference)} -> {cachedAsset.ReferenceCount}\n실제 키 값: {guidKey}"); return result; - - Debug.LogWarning($"[AssetManager] Type mismatch or invalid handle for key: {key}"); - return handle.Result as T; + } + + _cachedAssets.Remove(guidKey); + Debug.LogWarning($"[AssetManager] 무효한 핸들 제거됨: {GetSafeAssetName(assetReference)}\n실제 키 값: {guidKey}"); } - - // ✅ 새로 로드 - var newHandle = Addressables.LoadAssetAsync(key); + + var newHandle = Addressables.LoadAssetAsync(guidKey); await newHandle.Task; if (newHandle.Status == AsyncOperationStatus.Succeeded) { - _cachedHandles[key] = newHandle; + _cachedAssets[guidKey] = new CachedAsset(newHandle, 1); + if (_enableDebugLog) Debug.Log($"[AssetManager] 에셋 로드 및 캐싱 완료: {GetSafeAssetName(assetReference)} (참조수: {_cachedAssets[guidKey].ReferenceCount})\n실제 키 값: {guidKey}"); return newHandle.Result; } - Debug.LogError($"[AssetManager] Failed to load asset: {key}"); + if (newHandle.IsValid()) + { + Addressables.Release(newHandle); + } + + Debug.LogError($"[AssetManager] 에셋 로드 실패: {GetSafeAssetName(assetReference)}\n실제 키 값: {guidKey}"); + return null; + } + + /// + /// ScriptSingleton을 위한 동기 로딩 + /// + public T LoadAsset(string key) where T : Object + { + if (_cachedAssets.TryGetValue(key, out var cachedAsset)) + { + if (cachedAsset.Handle.IsValid() && cachedAsset.Handle.Result is T result) + { + cachedAsset.ReferenceCount++; + _cachedAssets[key] = cachedAsset; + + if (_enableDebugLog) Debug.Log($"[AssetManager] 동기 로딩 - 에셋 참조 카운트 증가: {key} -> {cachedAsset.ReferenceCount}"); + return result; + } + + _cachedAssets.Remove(key); + Debug.LogWarning($"[AssetManager] 무효한 핸들 제거됨: {key}"); + } + + var handle = Addressables.LoadAssetAsync(key); + var loaded = handle.WaitForCompletion(); + + if (handle.Status == AsyncOperationStatus.Succeeded) + { + _cachedAssets[key] = new CachedAsset(handle, 1); + if (_enableDebugLog) Debug.Log($"[AssetManager] 동기 로딩 - 에셋 로드 및 캐싱 완료: {key} (참조수: {key})"); + return loaded; + } + + if (handle.IsValid()) + { + Addressables.Release(handle); + } + + Debug.LogError($"[AssetManager] 동기 로딩 - 에셋 로드 실패: {key}"); return null; } - public static async Task> LoadAssetsByLabel(string label) where T : UnityEngine.Object + public async Task> LoadAssetsByLabel(string label) where T : Object { - var handle = Addressables.LoadAssetsAsync(label, null); + if (_cachedAssets.TryGetValue(label, out var cachedAsset)) + { + if (cachedAsset.Handle.IsValid() && cachedAsset.Handle.Result is IList cachedResult) + { + cachedAsset.ReferenceCount++; + _cachedAssets[label] = cachedAsset; + + if (_enableDebugLog) Debug.Log($"[AssetManager] 라벨 에셋 참조 카운트 증가: {label} -> {cachedAsset.ReferenceCount}"); + return cachedResult.ToList(); + } + + _cachedAssets.Remove(label); + if (_enableDebugLog) Debug.LogWarning($"[AssetManager] 무효한 라벨 핸들 제거됨: {label}"); + } + + var handle = Addressables.LoadAssetsAsync(label); await handle.Task; if (handle.Status == AsyncOperationStatus.Succeeded) + { + _cachedAssets[label] = new CachedAsset(handle, 1); + if (_enableDebugLog) Debug.Log($"[AssetManager] 라벨 에셋 로드 및 캐싱 완료: {label} (참조수: {_cachedAssets[label].ReferenceCount})"); return handle.Result.ToList(); + } - Debug.LogError($"[AssetManager] Failed to load assets with label: {label}"); + if (handle.IsValid()) + { + Addressables.Release(handle); + } + + Debug.LogError($"[AssetManager] 라벨 에셋 로드 실패: {label}"); return new List(); } - public static async Task LoadScene(AssetReference assetReference, LoadSceneMode mode = LoadSceneMode.Additive, bool activateOnLoad = true) + public void ReleaseAsset(AssetReference assetReference) { + var guidKey = assetReference.AssetGUID; + + if (_cachedAssets.TryGetValue(guidKey, out var cachedAsset)) + { + cachedAsset.ReferenceCount--; + + if (cachedAsset.ReferenceCount <= 0) + { + if (cachedAsset.Handle.IsValid()) + { + Addressables.Release(cachedAsset.Handle); + if (_enableDebugLog) Debug.Log($"[AssetManager] 에셋 실제 해제됨: {GetSafeAssetName(assetReference)}\n실제 키 값: {guidKey}"); + } + _cachedAssets.Remove(guidKey); + } + else + { + _cachedAssets[guidKey] = cachedAsset; + if (_enableDebugLog) Debug.Log($"[AssetManager] 에셋 참조 카운트 감소: {GetSafeAssetName(assetReference)} -> {cachedAsset.ReferenceCount}\n실제 키 값: {guidKey}"); + } + } + else + { + if (_enableDebugLog) Debug.LogWarning($"[AssetManager] 캐시에서 에셋을 찾을 수 없음: {GetSafeAssetName(assetReference)}\n실제 키 값: {guidKey}"); + } + } + + public void ReleaseAsset(string key) + { + if (_cachedAssets.TryGetValue(key, out var cachedAsset)) + { + cachedAsset.ReferenceCount--; + + if (cachedAsset.ReferenceCount <= 0) + { + if (cachedAsset.Handle.IsValid()) + { + Addressables.Release(cachedAsset.Handle); + if (_enableDebugLog) Debug.Log($"[AssetManager] 에셋 실제 해제됨: {key}"); + } + _cachedAssets.Remove(key); + } + else + { + _cachedAssets[key] = cachedAsset; + if (_enableDebugLog) Debug.Log($"[AssetManager] 에셋 참조 카운트 감소: {key} -> {cachedAsset.ReferenceCount}"); + } + } + else + { + if (_enableDebugLog) Debug.LogWarning($"[AssetManager] 캐시에서 에셋을 찾을 수 없음: {key}"); + } + } + + public async Task LoadScene(AssetReference assetReference, LoadSceneMode mode = LoadSceneMode.Additive, bool activateOnLoad = true) + { + var guidKey = assetReference.AssetGUID; + + if (_cachedScenes.TryGetValue(guidKey, out var cachedScene)) + { + if (cachedScene.Handle.IsValid()) + { + cachedScene.ReferenceCount++; + _cachedScenes[guidKey] = cachedScene; + + if (_enableDebugLog) Debug.Log($"[AssetManager] 씬 참조 카운트 증가: {GetSafeAssetName(assetReference)} -> {cachedScene.ReferenceCount}\n실제 키 값: {guidKey}"); + return cachedScene.Handle.Result; + } + + _cachedScenes.Remove(guidKey); + if (_enableDebugLog) Debug.LogWarning($"[AssetManager] 무효한 씬 핸들 제거됨: {GetSafeAssetName(assetReference)}\n실제 키 값: {guidKey}"); + } + var handle = Addressables.LoadSceneAsync(assetReference, mode, activateOnLoad); await handle.Task; if (handle.Status == AsyncOperationStatus.Succeeded) + { + _cachedScenes[guidKey] = new CachedScene(handle, 1); + var sceneName = handle.Result.Scene.name; + if (_enableDebugLog) Debug.Log($"[AssetManager] 씬 로드 및 캐싱 완료: {sceneName} (참조수: {_cachedScenes[guidKey].ReferenceCount})\n실제 키 값: {guidKey}"); return handle.Result; + } + + if (handle.IsValid()) + { + Addressables.UnloadSceneAsync(handle); + } - Debug.LogError($"Scene load failed: {assetReference}"); + Debug.LogError($"[AssetManager] 씬 로드 실패: {GetSafeAssetName(assetReference)}\n실제 키 값: {guidKey}"); return default; } - - public static async Task UnloadScene(SceneInstance sceneInstance) - { - var handle = Addressables.UnloadSceneAsync(sceneInstance); - await handle.Task; - } - public static void ReleaseAllCached() + public async Task UnloadScene(AssetReference assetReference) { - if (_cachedHandles.Count == 0) return; + var guidKey = assetReference.AssetGUID; - foreach (var kvp in _cachedHandles) + if (_cachedScenes.TryGetValue(guidKey, out var cachedScene)) { - var handle = kvp.Value; - if (handle.IsValid()) + cachedScene.ReferenceCount--; + + if (cachedScene.ReferenceCount <= 0) { - Addressables.Release(handle); - //Debug.Log($"[AssetManager] Released handle for key: {kvp.Key}"); + if (cachedScene.Handle.IsValid()) + { + var sceneName = cachedScene.Handle.Result.Scene.name; + await Addressables.UnloadSceneAsync(cachedScene.Handle).Task; + if (_enableDebugLog) Debug.Log($"[AssetManager] 씬 실제 언로드됨: {sceneName}\n실제 키 값: {guidKey}"); + } + _cachedScenes.Remove(guidKey); + } + else + { + _cachedScenes[guidKey] = cachedScene; + if (_enableDebugLog) Debug.Log($"[AssetManager] 씬 참조 카운트 감소: {GetSafeAssetName(assetReference)} -> {cachedScene.ReferenceCount}\n실제 키 값: {guidKey}"); } } - _cachedHandles.Clear(); - - Debug.Log("[AssetManager] 모든 캐시된 Addressable 리소스를 해제했습니다."); + else + { + if (_enableDebugLog) Debug.LogWarning($"[AssetManager] 캐시에서 씬을 찾을 수 없음: {GetSafeAssetName(assetReference)}\n실제 키 값: {guidKey}"); + } } - public static bool HasLabel(string addressKey, string label) + public void ReleaseAllCached() { -#if UNITY_EDITOR - var settings = AddressableAssetSettingsDefaultObject.Settings; - if (settings == null) return false; + foreach (var kvp in _cachedAssets) + { + var cachedAsset = kvp.Value; + if (cachedAsset.Handle.IsValid()) + { + Addressables.Release(cachedAsset.Handle); + } + } + _cachedAssets.Clear(); + + foreach (var kvp in _cachedScenes) + { + var cachedScene = kvp.Value; + if (cachedScene.Handle.IsValid()) + { + Addressables.UnloadSceneAsync(cachedScene.Handle); + } + } + _cachedScenes.Clear(); - 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 + if (_enableDebugLog) Debug.Log("[AssetManager] 모든 캐시된 Addressable 리소스를 강제 해제했습니다."); } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Game.meta b/Assets/_DDD/_Scripts/Game.meta new file mode 100644 index 000000000..72a1c55ab --- /dev/null +++ b/Assets/_DDD/_Scripts/Game.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c82c9604b41d4755b70d679f3a0a3947 +timeCreated: 1756279729 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameCharacter.meta b/Assets/_DDD/_Scripts/Game/GameCharacter.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameCharacter.meta rename to Assets/_DDD/_Scripts/Game/GameCharacter.meta diff --git a/Assets/_DDD/_Scripts/GameCharacter/IGameCharacter.cs b/Assets/_DDD/_Scripts/Game/GameCharacter/IGameCharacter.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameCharacter/IGameCharacter.cs rename to Assets/_DDD/_Scripts/Game/GameCharacter/IGameCharacter.cs diff --git a/Assets/_DDD/_Scripts/GameCharacter/IGameCharacter.cs.meta b/Assets/_DDD/_Scripts/Game/GameCharacter/IGameCharacter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameCharacter/IGameCharacter.cs.meta rename to Assets/_DDD/_Scripts/Game/GameCharacter/IGameCharacter.cs.meta diff --git a/Assets/_DDD/_Scripts/GameCharacter/IMovementConstraint.cs b/Assets/_DDD/_Scripts/Game/GameCharacter/IMovementConstraint.cs similarity index 72% rename from Assets/_DDD/_Scripts/GameCharacter/IMovementConstraint.cs rename to Assets/_DDD/_Scripts/Game/GameCharacter/IMovementConstraint.cs index 6e290b4e9..064721ade 100644 --- a/Assets/_DDD/_Scripts/GameCharacter/IMovementConstraint.cs +++ b/Assets/_DDD/_Scripts/Game/GameCharacter/IMovementConstraint.cs @@ -1,4 +1,4 @@ -namespace DDD +namespace DDD.Restaurant { public interface IMovementConstraint { diff --git a/Assets/_DDD/_Scripts/GameCharacter/IMovementConstraint.cs.meta b/Assets/_DDD/_Scripts/Game/GameCharacter/IMovementConstraint.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameCharacter/IMovementConstraint.cs.meta rename to Assets/_DDD/_Scripts/Game/GameCharacter/IMovementConstraint.cs.meta diff --git a/Assets/_DDD/_Scripts/GameCharacter/SpineController.cs b/Assets/_DDD/_Scripts/Game/GameCharacter/SpineController.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameCharacter/SpineController.cs rename to Assets/_DDD/_Scripts/Game/GameCharacter/SpineController.cs diff --git a/Assets/_DDD/_Scripts/GameCharacter/SpineController.cs.meta b/Assets/_DDD/_Scripts/Game/GameCharacter/SpineController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameCharacter/SpineController.cs.meta rename to Assets/_DDD/_Scripts/Game/GameCharacter/SpineController.cs.meta diff --git a/Assets/_DDD/_Scripts/GameController.meta b/Assets/_DDD/_Scripts/Game/GameController.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameController.meta rename to Assets/_DDD/_Scripts/Game/GameController.meta diff --git a/Assets/_DDD/_Scripts/GameController/GameController.cs b/Assets/_DDD/_Scripts/Game/GameController/GameController.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameController/GameController.cs rename to Assets/_DDD/_Scripts/Game/GameController/GameController.cs diff --git a/Assets/_DDD/_Scripts/GameController/GameController.cs.meta b/Assets/_DDD/_Scripts/Game/GameController/GameController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameController/GameController.cs.meta rename to Assets/_DDD/_Scripts/Game/GameController/GameController.cs.meta diff --git a/Assets/_DDD/_Scripts/GameData.meta b/Assets/_DDD/_Scripts/Game/GameData.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameData.meta rename to Assets/_DDD/_Scripts/Game/GameData.meta diff --git a/Assets/_DDD/_Scripts/GameData/DataSo.cs b/Assets/_DDD/_Scripts/Game/GameData/DataAsset.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameData/DataSo.cs rename to Assets/_DDD/_Scripts/Game/GameData/DataAsset.cs index bff309916..e49c3135f 100644 --- a/Assets/_DDD/_Scripts/GameData/DataSo.cs +++ b/Assets/_DDD/_Scripts/Game/GameData/DataAsset.cs @@ -6,7 +6,7 @@ namespace DDD { - public class DataSo : ScriptableObject where T : IId + public class DataAsset : ScriptableObject where T : IId { [FormerlySerializedAs("Datas")] [SerializeField] protected List _datas = new(); diff --git a/Assets/_DDD/_Scripts/GameData/DataSo.cs.meta b/Assets/_DDD/_Scripts/Game/GameData/DataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameData/DataSo.cs.meta rename to Assets/_DDD/_Scripts/Game/GameData/DataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GameData/DataManager.cs b/Assets/_DDD/_Scripts/Game/GameData/DataManager.cs similarity index 93% rename from Assets/_DDD/_Scripts/GameData/DataManager.cs rename to Assets/_DDD/_Scripts/Game/GameData/DataManager.cs index 51277cba2..124a3f8e5 100644 --- a/Assets/_DDD/_Scripts/GameData/DataManager.cs +++ b/Assets/_DDD/_Scripts/Game/GameData/DataManager.cs @@ -32,7 +32,7 @@ public void PostInit() private async Task LoadAllGameDataSo() { - var soList = await AssetManager.LoadAssetsByLabel(SoLabel); + var soList = await AssetManager.Instance.LoadAssetsByLabel(SoLabel); foreach (var so in soList) { @@ -45,7 +45,7 @@ private async Task LoadAllGameDataSo() private async Task LoadSpriteAtlas() { - List spriteAtlases = await AssetManager.LoadAssetsByLabel(DataConstants.AtlasLabel); + List spriteAtlases = await AssetManager.Instance.LoadAssetsByLabel(DataConstants.AtlasLabel); _spriteAtlas = new Dictionary(spriteAtlases.Count); foreach (var atlas in spriteAtlases) diff --git a/Assets/_DDD/_Scripts/GameData/DataManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameData/DataManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameData/DataManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameData/DataManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameData/GameData.cs b/Assets/_DDD/_Scripts/Game/GameData/GameData.cs similarity index 55% rename from Assets/_DDD/_Scripts/GameData/GameData.cs rename to Assets/_DDD/_Scripts/Game/GameData/GameData.cs index 5bdd6653f..43933000f 100644 --- a/Assets/_DDD/_Scripts/GameData/GameData.cs +++ b/Assets/_DDD/_Scripts/Game/GameData/GameData.cs @@ -21,19 +21,9 @@ public async Task LoadData() { return; } - - var gameLocalizationDataHandle = _gameLocalizationData.LoadAssetAsync(); - var test = AssetManager.LoadAsset(_gameLocalizationData.AssetGUID); - var popupUiDataHandle = _uiData.LoadAssetAsync(); - await gameLocalizationDataHandle.Task; - await popupUiDataHandle.Task; - - LocalizationData = gameLocalizationDataHandle.Result; - UiData = popupUiDataHandle.Result; - - Debug.Assert(LocalizationData != null, "GameLocalizationData is null"); - Debug.Assert(UiData != null, "UiData is null"); + LocalizationData = await AssetManager.Instance.LoadAssetAsync(_gameLocalizationData); + UiData = await AssetManager.Instance.LoadAssetAsync(_uiData); _isLoaded = true; } @@ -41,8 +31,16 @@ public async Task LoadData() private void OnDisable() { if (_isLoaded == false) return; + + var assetManager = AssetManager.Instance; + if (!assetManager) return; - _gameLocalizationData.ReleaseAsset(); + AssetManager.Instance.ReleaseAsset(_gameLocalizationData); + AssetManager.Instance.ReleaseAsset(_uiData); + + LocalizationData = null; + UiData = null; + _isLoaded = false; } } diff --git a/Assets/_DDD/_Scripts/GameData/GameData.cs.meta b/Assets/_DDD/_Scripts/Game/GameData/GameData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameData/GameData.cs.meta rename to Assets/_DDD/_Scripts/Game/GameData/GameData.cs.meta diff --git a/Assets/_DDD/_Scripts/GameData/GameLocalizationData.cs b/Assets/_DDD/_Scripts/Game/GameData/GameLocalizationData.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameData/GameLocalizationData.cs rename to Assets/_DDD/_Scripts/Game/GameData/GameLocalizationData.cs diff --git a/Assets/_DDD/_Scripts/GameData/GameLocalizationData.cs.meta b/Assets/_DDD/_Scripts/Game/GameData/GameLocalizationData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameData/GameLocalizationData.cs.meta rename to Assets/_DDD/_Scripts/Game/GameData/GameLocalizationData.cs.meta diff --git a/Assets/_DDD/_Scripts/GameData/IId.cs b/Assets/_DDD/_Scripts/Game/GameData/IId.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameData/IId.cs rename to Assets/_DDD/_Scripts/Game/GameData/IId.cs diff --git a/Assets/_DDD/_Scripts/GameData/IId.cs.meta b/Assets/_DDD/_Scripts/Game/GameData/IId.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameData/IId.cs.meta rename to Assets/_DDD/_Scripts/Game/GameData/IId.cs.meta diff --git a/Assets/_DDD/_Scripts/GameData/PopupUiData.cs b/Assets/_DDD/_Scripts/Game/GameData/PopupUiData.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameData/PopupUiData.cs rename to Assets/_DDD/_Scripts/Game/GameData/PopupUiData.cs diff --git a/Assets/_DDD/_Scripts/GameData/PopupUiData.cs.meta b/Assets/_DDD/_Scripts/Game/GameData/PopupUiData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameData/PopupUiData.cs.meta rename to Assets/_DDD/_Scripts/Game/GameData/PopupUiData.cs.meta diff --git a/Assets/_DDD/_Scripts/GameEvent.meta b/Assets/_DDD/_Scripts/Game/GameEvent.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameEvent.meta rename to Assets/_DDD/_Scripts/Game/GameEvent.meta diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs b/Assets/_DDD/_Scripts/Game/GameEvent/GameEvents.cs similarity index 83% rename from Assets/_DDD/_Scripts/GameEvent/GameEvents.cs rename to Assets/_DDD/_Scripts/Game/GameEvent/GameEvents.cs index f1242308e..a899de9f8 100644 --- a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs +++ b/Assets/_DDD/_Scripts/Game/GameEvent/GameEvents.cs @@ -18,13 +18,6 @@ public static class GameEvents public static InventoryChangedEvent InventoryChangedEvent = new(); public static SmartVariablesDirtyEvent SmartVariablesDirtyEvent = new(); } - - public static class RestaurantEvents - { - public static ItemSlotSelectedEvent ItemSlotSelectedEvent = new(); - public static TodayMenuAddedEvent TodayMenuAddedEvent = new(); - public static TodayMenuRemovedEvent TodayMenuRemovedEvent = new(); - } // public static class VoyageEvents // { @@ -105,20 +98,4 @@ public class SmartVariablesDirtyEvent : IEvent { public SmartVariablesDomain DomainFlags; } - - #region RestaurantInteractionEvents - - public class ItemSlotSelectedEvent : IEvent - { - public ItemModel Model; - } - - public class TodayMenuAddedEvent : IEvent {} - - public class TodayMenuRemovedEvent : IEvent - { - public InventoryCategoryType InventoryCategoryType; - } - - #endregion } diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs.meta b/Assets/_DDD/_Scripts/Game/GameEvent/GameEvents.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameEvent/GameEvents.cs.meta rename to Assets/_DDD/_Scripts/Game/GameEvent/GameEvents.cs.meta diff --git a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs b/Assets/_DDD/_Scripts/Game/GameEvent/IInteractable.cs similarity index 95% rename from Assets/_DDD/_Scripts/GameEvent/IInteractable.cs rename to Assets/_DDD/_Scripts/Game/GameEvent/IInteractable.cs index 7e3ab45d0..72831c1fd 100644 --- a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs +++ b/Assets/_DDD/_Scripts/Game/GameEvent/IInteractable.cs @@ -10,7 +10,6 @@ public enum InteractionType : uint None = 0u, RestaurantManagement = 1u << 0, RestaurantOrder = 1u << 1, - RestaurantMeal = 1u << 2, RestaurantCook = 1u << 3, All = 0xFFFFFFFFu } @@ -41,7 +40,7 @@ public interface IInteractable { bool CanInteract(); bool IsInteractionHidden(); - bool OnInteracted(IInteractor interactor, ScriptableObject causerPayload = null); + void OnInteracted(IInteractor interactor, ScriptableObject causerPayload = null); InteractionType GetInteractionType(); GameObject GetInteractableGameObject(); void InitializeInteraction(InteractionType interactionType); diff --git a/Assets/_DDD/_Scripts/GameEvent/IInteractable.cs.meta b/Assets/_DDD/_Scripts/Game/GameEvent/IInteractable.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameEvent/IInteractable.cs.meta rename to Assets/_DDD/_Scripts/Game/GameEvent/IInteractable.cs.meta diff --git a/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs b/Assets/_DDD/_Scripts/Game/GameEvent/InteractionSubsystem.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs rename to Assets/_DDD/_Scripts/Game/GameEvent/InteractionSubsystem.cs diff --git a/Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/Game/GameEvent/InteractionSubsystem.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameEvent/InteractionSubsystem.cs.meta rename to Assets/_DDD/_Scripts/Game/GameEvent/InteractionSubsystem.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFlow.meta b/Assets/_DDD/_Scripts/Game/GameFlow.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow.meta rename to Assets/_DDD/_Scripts/Game/GameFlow.meta diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowDataSo.cs b/Assets/_DDD/_Scripts/Game/GameFlow/GameFlowDataSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/GameFlowDataSo.cs rename to Assets/_DDD/_Scripts/Game/GameFlow/GameFlowDataSo.cs diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowDataSo.cs.meta b/Assets/_DDD/_Scripts/Game/GameFlow/GameFlowDataSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/GameFlowDataSo.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFlow/GameFlowDataSo.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs b/Assets/_DDD/_Scripts/Game/GameFlow/GameFlowManager.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs rename to Assets/_DDD/_Scripts/Game/GameFlow/GameFlowManager.cs diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameFlow/GameFlowManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/GameFlowManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFlow/GameFlowManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowSceneMappingSo.cs b/Assets/_DDD/_Scripts/Game/GameFlow/GameFlowSceneMappingSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/GameFlowSceneMappingSo.cs rename to Assets/_DDD/_Scripts/Game/GameFlow/GameFlowSceneMappingSo.cs diff --git a/Assets/_DDD/_Scripts/GameFlow/GameFlowSceneMappingSo.cs.meta b/Assets/_DDD/_Scripts/Game/GameFlow/GameFlowSceneMappingSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/GameFlowSceneMappingSo.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFlow/GameFlowSceneMappingSo.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFlow/IGameFlowHandler.cs b/Assets/_DDD/_Scripts/Game/GameFlow/IGameFlowHandler.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/IGameFlowHandler.cs rename to Assets/_DDD/_Scripts/Game/GameFlow/IGameFlowHandler.cs diff --git a/Assets/_DDD/_Scripts/GameFlow/IGameFlowHandler.cs.meta b/Assets/_DDD/_Scripts/Game/GameFlow/IGameFlowHandler.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFlow/IGameFlowHandler.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFlow/IGameFlowHandler.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework.meta b/Assets/_DDD/_Scripts/Game/GameFramework.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework.meta rename to Assets/_DDD/_Scripts/Game/GameFramework.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus.meta b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/EventBus.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/EventBus.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/EventBus.cs similarity index 96% rename from Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/EventBus/EventBus.cs index 56ea0f779..cfc7a6420 100644 --- a/Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs +++ b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/EventBus.cs @@ -39,7 +39,7 @@ public static void Broadcast(T evt) where T : IEvent { foreach (var handler in list.Cast>()) { - handler.Invoke(evt); + handler.HandleEvent(evt); } } } diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/EventBus.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/EventBus/EventBus.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/IEvent.cs b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEvent.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/EventBus/IEvent.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEvent.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/IEvent.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEvent.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/EventBus/IEvent.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEvent.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEventHandler.cs similarity index 72% rename from Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEventHandler.cs index 2239da7c0..03ce3f4b8 100644 --- a/Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs +++ b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEventHandler.cs @@ -2,6 +2,6 @@ namespace DDD { public interface IEventHandler where T : IEvent { - void Invoke(T evt); + void HandleEvent(T evt); } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEventHandler.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/EventBus/IEventHandler.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/GameManager.cs b/Assets/_DDD/_Scripts/Game/GameFramework/GameManager.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/GameManager.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/GameManager.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/GameManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/GameManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/GameManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/GameManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/IManager.cs b/Assets/_DDD/_Scripts/Game/GameFramework/IManager.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/IManager.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/IManager.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/IManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/IManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/IManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/IManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetData.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetData.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetData.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetData.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetData.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetData.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetData.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetWebClient.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetWebClient.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetWebClient.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetWebClient.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetWebClient.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetWebClient.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/GoogleSheetWebClient.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/GoogleSheetWebClient.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationExporter.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationExporter.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationExporter.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationExporter.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationExporter.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationExporter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationExporter.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationExporter.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationImporter.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationImporter.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationImporter.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationImporter.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationImporter.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationImporter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationImporter.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationImporter.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationManager.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationManager.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationSyncTool.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationSyncTool.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationSyncTool.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationSyncTool.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationSyncTool.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationSyncTool.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/LocalizationSyncTool.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationSyncTool.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/SmartStringVariables.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/SmartStringVariables.cs similarity index 98% rename from Assets/_DDD/_Scripts/GameFramework/Localization/SmartStringVariables.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/SmartStringVariables.cs index 0dbf0df71..cb58e35e0 100644 --- a/Assets/_DDD/_Scripts/GameFramework/Localization/SmartStringVariables.cs +++ b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/SmartStringVariables.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using DDD.Restaurant; using UnityEngine; using UnityEngine.Localization.SmartFormat.PersistentVariables; @@ -71,7 +72,7 @@ public void PostInit() EventBus.Register(this); } - public void Invoke(SmartVariablesDirtyEvent evt) + public void HandleEvent(SmartVariablesDirtyEvent evt) { var flags = evt.DomainFlags; if (flags == SmartVariablesDomain.All) diff --git a/Assets/_DDD/_Scripts/GameFramework/Localization/SmartStringVariables.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/SmartStringVariables.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Localization/SmartStringVariables.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Localization/SmartStringVariables.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.cs b/Assets/_DDD/_Scripts/Game/GameFramework/ManagerDefinitionSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/ManagerDefinitionSo.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/ManagerDefinitionSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/ManagerDefinitionSo.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/ManagerDefinitionSo.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/PlayerManager.cs b/Assets/_DDD/_Scripts/Game/GameFramework/PlayerManager.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/PlayerManager.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/PlayerManager.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/PlayerManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/PlayerManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/PlayerManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/PlayerManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Scene.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/FadeSceneTransitionHandlerSo.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneManager.cs similarity index 96% rename from Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneManager.cs index 87a4f38ef..b58aa5bdf 100644 --- a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs +++ b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneManager.cs @@ -84,7 +84,7 @@ public async Task PreloadAll() continue; } - var instance = await AssetManager.LoadScene(flowAssetPair.Value, activateOnLoad:false); + var instance = await AssetManager.Instance.LoadScene(flowAssetPair.Value, activateOnLoad:false); if (!instance.Scene.IsValid()) { Debug.LogError($"[SceneManager] {flowAssetPair.Key}의 씬 로딩 실패"); @@ -114,7 +114,7 @@ public async Task PreloadScene(GameFlowState gameFlowState) return; } - var loadedInstance = await AssetManager.LoadScene(assetRef); + var loadedInstance = await AssetManager.Instance.LoadScene(assetRef); if (!loadedInstance.Scene.IsValid()) { Debug.LogError($"[SceneManager] {gameFlowState}의 씬 로딩 실패"); @@ -170,7 +170,7 @@ public async Task UnloadScene(GameFlowState gameFlowState) } _loadedSceneDatas.Remove(gameFlowState); - await AssetManager.UnloadScene(sceneData.SceneInstance.Value); + await AssetManager.Instance.UnloadScene(assetRef); } } diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandler.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandler.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandler.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandler.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandler.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandler.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandler.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandler.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandlerSo.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandlerSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandlerSo.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandlerSo.cs diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandlerSo.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandlerSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/Scene/SceneTransitionHandlerSo.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/Scene/SceneTransitionHandlerSo.cs.meta diff --git a/Assets/_DDD/_Scripts/GameFramework/TimeManager.cs b/Assets/_DDD/_Scripts/Game/GameFramework/TimeManager.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameFramework/TimeManager.cs rename to Assets/_DDD/_Scripts/Game/GameFramework/TimeManager.cs index 536e4bcb0..6ea575988 100644 --- a/Assets/_DDD/_Scripts/GameFramework/TimeManager.cs +++ b/Assets/_DDD/_Scripts/Game/GameFramework/TimeManager.cs @@ -68,7 +68,7 @@ private void UpdateTimeScale() public bool IsPaused => Mathf.Approximately(CurrentTimeScale, 0f); - public void Invoke(TimeScaleChangeEvent evt) + public void HandleEvent(TimeScaleChangeEvent evt) { if (evt.NewTimeScale < 1f) { diff --git a/Assets/_DDD/_Scripts/GameFramework/TimeManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameFramework/TimeManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameFramework/TimeManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameFramework/TimeManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameState.meta b/Assets/_DDD/_Scripts/Game/GameState.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameState.meta rename to Assets/_DDD/_Scripts/Game/GameState.meta diff --git a/Assets/_DDD/_Scripts/GameState/GameLevelState.cs b/Assets/_DDD/_Scripts/Game/GameState/GameLevelState.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameState/GameLevelState.cs rename to Assets/_DDD/_Scripts/Game/GameState/GameLevelState.cs diff --git a/Assets/_DDD/_Scripts/GameState/GameLevelState.cs.meta b/Assets/_DDD/_Scripts/Game/GameState/GameLevelState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameState/GameLevelState.cs.meta rename to Assets/_DDD/_Scripts/Game/GameState/GameLevelState.cs.meta diff --git a/Assets/_DDD/_Scripts/GameState/GameState.cs b/Assets/_DDD/_Scripts/Game/GameState/GameState.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameState/GameState.cs rename to Assets/_DDD/_Scripts/Game/GameState/GameState.cs diff --git a/Assets/_DDD/_Scripts/GameState/GameState.cs.meta b/Assets/_DDD/_Scripts/Game/GameState/GameState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameState/GameState.cs.meta rename to Assets/_DDD/_Scripts/Game/GameState/GameState.cs.meta diff --git a/Assets/_DDD/_Scripts/GameState/InventoryItemData.cs b/Assets/_DDD/_Scripts/Game/GameState/InventoryItemData.cs similarity index 80% rename from Assets/_DDD/_Scripts/GameState/InventoryItemData.cs rename to Assets/_DDD/_Scripts/Game/GameState/InventoryItemData.cs index 584f5c162..812fe42a7 100644 --- a/Assets/_DDD/_Scripts/GameState/InventoryItemData.cs +++ b/Assets/_DDD/_Scripts/Game/GameState/InventoryItemData.cs @@ -18,6 +18,6 @@ public InventoryItemData(string id, int quantity) Quantity = quantity; } - public ItemData ItemData => InventoryManager.Instance.GetItemDataByIdOrNull(Id); + public ItemDataEntry ItemDataEntry => InventoryManager.Instance.GetItemDataByIdOrNull(Id); } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameState/InventoryItemData.cs.meta b/Assets/_DDD/_Scripts/Game/GameState/InventoryItemData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameState/InventoryItemData.cs.meta rename to Assets/_DDD/_Scripts/Game/GameState/InventoryItemData.cs.meta diff --git a/Assets/_DDD/_Scripts/GameState/InventoryManager.cs b/Assets/_DDD/_Scripts/Game/GameState/InventoryManager.cs similarity index 89% rename from Assets/_DDD/_Scripts/GameState/InventoryManager.cs rename to Assets/_DDD/_Scripts/Game/GameState/InventoryManager.cs index 006d58597..e1c3916ac 100644 --- a/Assets/_DDD/_Scripts/GameState/InventoryManager.cs +++ b/Assets/_DDD/_Scripts/Game/GameState/InventoryManager.cs @@ -19,7 +19,7 @@ public class InventoryManager : Singleton, IManager { [Title("아이템 전체 목록")] [ShowInInspector, ReadOnly] - private Dictionary _allItemDataLookup; + private Dictionary _allItemDataLookup; [Title("아이템 보유 목록")] [ShowInInspector, ReadOnly] @@ -27,6 +27,7 @@ public class InventoryManager : Singleton, IManager #if UNITY_EDITOR [Title("테스트용")] + [SerializeField] private InventoryTestDataSo _inventoryTestDataSo; #endif @@ -47,7 +48,7 @@ public void PostInit() private void InitializeItemData() { - var itemDataSo = DataManager.Instance.GetDataSo(); + var itemDataSo = DataManager.Instance.GetDataSo(); Debug.Assert(itemDataSo != null, "itemDataSo != null"); _allItemDataLookup = itemDataSo.GetDataList() @@ -62,12 +63,8 @@ private void InitializeItemData() } #if UNITY_EDITOR - private async void ApplyEditorTestData() + private void ApplyEditorTestData() { - _inventoryTestDataSo = await AssetManager.LoadAsset(DataConstants.InventoryTestDataSo); - - if (_inventoryTestDataSo == null || !_inventoryTestDataSo.UseTestData) return; - foreach (var entry in _inventoryTestDataSo.TestItems) { if (string.IsNullOrWhiteSpace(entry.ItemId)) continue; @@ -132,12 +129,12 @@ public bool RemoveItem(string id, int quantity = 1) return true; } - public IReadOnlyDictionary AllItemDataLookup => _allItemDataLookup; + public IReadOnlyDictionary AllItemDataLookup => _allItemDataLookup; public IReadOnlyDictionary InventoryItems => _inventoryItemDatas; public bool ContainInventoryItem(string id) => _inventoryItemDatas.ContainsKey(id); public bool TryGetInventoryItemData(string id, out InventoryItemData inventoryItemData) => _inventoryItemDatas.TryGetValue(id, out inventoryItemData); public int GetItemCount(string id) => _inventoryItemDatas.TryGetValue(id, out var itemData) ? itemData.Quantity : 0; - public ItemData GetItemDataByIdOrNull(string id) + public ItemDataEntry GetItemDataByIdOrNull(string id) { _allItemDataLookup.TryGetValue(id, out var itemData); return itemData; diff --git a/Assets/_DDD/_Scripts/GameState/InventoryManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameState/InventoryManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameState/InventoryManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameState/InventoryManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameState/InventoryTestDataSo.cs b/Assets/_DDD/_Scripts/Game/GameState/InventoryTestDataSo.cs similarity index 91% rename from Assets/_DDD/_Scripts/GameState/InventoryTestDataSo.cs rename to Assets/_DDD/_Scripts/Game/GameState/InventoryTestDataSo.cs index 2b6f69b17..32f98620c 100644 --- a/Assets/_DDD/_Scripts/GameState/InventoryTestDataSo.cs +++ b/Assets/_DDD/_Scripts/Game/GameState/InventoryTestDataSo.cs @@ -28,14 +28,14 @@ private IEnumerable GetAllItemIds() .Select(d => d.Id); } - private ItemDataSo LoadItemDataSo() + private ItemDataAsset LoadItemDataSo() { // 경로는 프로젝트에 맞게 조정 필요 - string[] guids = AssetDatabase.FindAssets("t:ItemDataSo"); + string[] guids = AssetDatabase.FindAssets("t:ItemDataAsset"); if (guids.Length == 0) return null; string path = AssetDatabase.GUIDToAssetPath(guids[0]); - return AssetDatabase.LoadAssetAtPath(path); + return AssetDatabase.LoadAssetAtPath(path); } } diff --git a/Assets/_DDD/_Scripts/GameState/InventoryTestDataSo.cs.meta b/Assets/_DDD/_Scripts/Game/GameState/InventoryTestDataSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameState/InventoryTestDataSo.cs.meta rename to Assets/_DDD/_Scripts/Game/GameState/InventoryTestDataSo.cs.meta diff --git a/Assets/_DDD/_Scripts/GameState/TestInventoryEditorTool.cs b/Assets/_DDD/_Scripts/Game/GameState/TestInventoryEditorTool.cs similarity index 92% rename from Assets/_DDD/_Scripts/GameState/TestInventoryEditorTool.cs rename to Assets/_DDD/_Scripts/Game/GameState/TestInventoryEditorTool.cs index c251a1b48..f66837dbf 100644 --- a/Assets/_DDD/_Scripts/GameState/TestInventoryEditorTool.cs +++ b/Assets/_DDD/_Scripts/Game/GameState/TestInventoryEditorTool.cs @@ -47,10 +47,10 @@ private void RemoveItem() private IEnumerable GetItemIds() { - if (!Application.isPlaying || DataManager.Instance?.GetDataSo() == null) + if (!Application.isPlaying || DataManager.Instance?.GetDataSo() == null) return Enumerable.Empty(); - return DataManager.Instance.GetDataSo().GetDataList() + return DataManager.Instance.GetDataSo().GetDataList() .Select(data => data.Id) .Where(id => !string.IsNullOrEmpty(id)); } diff --git a/Assets/_DDD/_Scripts/GameState/TestInventoryEditorTool.cs.meta b/Assets/_DDD/_Scripts/Game/GameState/TestInventoryEditorTool.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameState/TestInventoryEditorTool.cs.meta rename to Assets/_DDD/_Scripts/Game/GameState/TestInventoryEditorTool.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi.meta b/Assets/_DDD/_Scripts/Game/GameUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi.meta rename to Assets/_DDD/_Scripts/Game/GameUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/BaseUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/BaseUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/BaseUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/BaseUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/BaseViewModelUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseViewModelUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/BaseViewModelUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseViewModelUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/BaseViewModelUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseViewModelUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/BaseViewModelUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/BaseViewModelUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/FadeUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/FadeUi.cs similarity index 93% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/FadeUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/FadeUi.cs index e9ea42a6f..6cb05137b 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/FadeUi.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/FadeUi.cs @@ -23,12 +23,12 @@ protected override void OnCreatedInitialize() EventBus.Register(this); } - public void Invoke(FadeInEvent evt) + public void HandleEvent(FadeInEvent evt) { _ = FadeInAsync(evt); } - public void Invoke(FadeOutEvent evt) + public void HandleEvent(FadeOutEvent evt) { _ = FadeOutAsync(evt); } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/FadeUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/FadeUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/FadeUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/FadeUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs index 7dc140664..11ff40751 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs @@ -31,7 +31,7 @@ protected override void OnCreatedInitialize() EventBus.Register(this); } - public void Invoke(ShowGlobalMessageEvent evt) + public void HandleEvent(ShowGlobalMessageEvent evt) { _messageQueue.Enqueue(evt); TryDisplayNext(); diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/CommonUis/GlobalMessageUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/Huds.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/Huds.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/Huds.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/Huds.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/Huds/RestaurantHud.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/Huds/RestaurantHud.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/Huds/RestaurantHud.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/Huds/RestaurantHud.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/Huds/RestaurantHud.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/Huds/RestaurantHud.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/Huds/RestaurantHud.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/Huds/RestaurantHud.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/InteractionUis.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/InteractionUis.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs similarity index 94% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs index fa5191a46..9062a088b 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs @@ -35,12 +35,12 @@ protected override void OnCreatedInitialize() EventBus.Register(this); } - public void Invoke(ShowInteractionUiEvent evt) + public void HandleEvent(ShowInteractionUiEvent evt) { ShowInteractionUiEvent(evt); } - public void Invoke(HideInteractionUiEvent evt) + public void HandleEvent(HideInteractionUiEvent evt) { HideInteractionUiEvent(evt); } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/BasePopupUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/BasePopupUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/BasePopupUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/BasePopupUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/BasePopupUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/BasePopupUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/BasePopupUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/BasePopupUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/PopupUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/PopupUi.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/PopupUi.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/PopupUi.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/UiState.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/UiState.cs similarity index 98% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/UiState.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/UiState.cs index ecb2e0bc5..5070d8a98 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/UiState.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/UiState.cs @@ -62,7 +62,7 @@ public void UnregisterPopupUI(BasePopupUi ui) } } - public void Invoke(OpenPopupUiEvent evt) + public void HandleEvent(OpenPopupUiEvent evt) { if (_popupUis.TryGetValue(evt.UiType, out var popup)) { @@ -82,7 +82,7 @@ public void Invoke(OpenPopupUiEvent evt) } } - public void Invoke(ClosePopupUiEvent evt) + public void HandleEvent(ClosePopupUiEvent evt) { if (_popupUis.TryGetValue(evt.UiType, out var popup)) { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/UiState.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/UiState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/UiState.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/UiState.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/SimpleViewModel.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/SimpleViewModel.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/SimpleViewModel.cs rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/SimpleViewModel.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/SimpleViewModel.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/SimpleViewModel.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/SimpleViewModel.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/BaseUi/SimpleViewModel.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/CommonButton.cs b/Assets/_DDD/_Scripts/Game/GameUi/CommonButton.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/CommonButton.cs rename to Assets/_DDD/_Scripts/Game/GameUi/CommonButton.cs diff --git a/Assets/_DDD/_Scripts/GameUi/CommonButton.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/CommonButton.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/CommonButton.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/CommonButton.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/ScrollViewUi.meta b/Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/ScrollViewUi.meta rename to Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/ScrollViewUi/AutoScrollToSelected.cs b/Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/AutoScrollToSelected.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/ScrollViewUi/AutoScrollToSelected.cs rename to Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/AutoScrollToSelected.cs diff --git a/Assets/_DDD/_Scripts/GameUi/ScrollViewUi/AutoScrollToSelected.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/AutoScrollToSelected.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/ScrollViewUi/AutoScrollToSelected.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/AutoScrollToSelected.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/ScrollViewUi/IAutoScrollItem.cs b/Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/IAutoScrollItem.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/ScrollViewUi/IAutoScrollItem.cs rename to Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/IAutoScrollItem.cs diff --git a/Assets/_DDD/_Scripts/GameUi/ScrollViewUi/IAutoScrollItem.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/IAutoScrollItem.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/ScrollViewUi/IAutoScrollItem.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/ScrollViewUi/IAutoScrollItem.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/UiManager.cs b/Assets/_DDD/_Scripts/Game/GameUi/UiManager.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/UiManager.cs rename to Assets/_DDD/_Scripts/Game/GameUi/UiManager.cs diff --git a/Assets/_DDD/_Scripts/GameUi/UiManager.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/UiManager.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/UiManager.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/UiManager.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingContext.cs b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingContext.cs similarity index 98% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingContext.cs rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingContext.cs index fb4faf61f..18533567b 100644 --- a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingContext.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingContext.cs @@ -104,7 +104,7 @@ private object GetPropertyValue(string propertyPath) { if (_dataContext == null) return null; - // 중첩 속성 지원 (예: "ItemData.Name") + // 중첩 속성 지원 (예: "ItemDataEntry.Name") var properties = propertyPath.Split('.'); object current = _dataContext; diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingContext.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingContext.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingContext.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingContext.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingHelper.cs b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingHelper.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingHelper.cs rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingHelper.cs diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingHelper.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingHelper.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingHelper.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingHelper.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingPath.cs b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingPath.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingPath.cs rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingPath.cs diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingPath.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingPath.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/BindingPath.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/BindingPath.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/IBindingTarget.cs b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/IBindingTarget.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/IBindingTarget.cs rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/IBindingTarget.cs diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Binding/IBindingTarget.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/IBindingTarget.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Binding/IBindingTarget.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Binding/IBindingTarget.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Converters.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Converters.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Converters/CommonConverters.cs b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/CommonConverters.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Converters/CommonConverters.cs rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/CommonConverters.cs diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Converters/CommonConverters.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/CommonConverters.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Converters/CommonConverters.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/CommonConverters.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Converters/IValueConverter.cs b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/IValueConverter.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Converters/IValueConverter.cs rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/IValueConverter.cs diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/Converters/IValueConverter.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/IValueConverter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/Converters/IValueConverter.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/Converters/IValueConverter.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/IUiView.cs b/Assets/_DDD/_Scripts/Game/GameUi/Utils/IUiView.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/IUiView.cs rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/IUiView.cs diff --git a/Assets/_DDD/_Scripts/GameUi/Utils/IUiView.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/Utils/IUiView.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/Utils/IUiView.cs.meta rename to Assets/_DDD/_Scripts/Game/GameUi/Utils/IUiView.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs b/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs deleted file mode 100644 index 95ec90f6c..000000000 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; - -namespace DDD -{ - public static class DrinkDataExtensions - { - public static List GetIngredients(this DrinkData data) - => CraftingHelper.ExtractIngredients( - data.IngredientKey1, data.IngredientAmount1, - data.IngredientKey2, data.IngredientAmount2, - data.IngredientKey3, data.IngredientAmount3, - data.IngredientKey4, data.IngredientAmount4 - ); - - public static List GetTasteDatas(this DrinkData data) - => CraftingHelper.ResolveTasteDatas( - new[] { data.TasteKey1, data.TasteKey2, data.TasteKey3, data.TasteKey4, data.TasteKey5, data.TasteKey6 }, - DataManager.Instance.GetDataSo() - ); - - public static int GetCraftableCount(this DrinkData data) - => CraftingHelper.GetCraftableCount(data.GetIngredients()); - - public static bool TryConsumeIngredients(this DrinkData data, int count = 1) - => CraftingHelper.TryConsumeIngredients(data.GetIngredients(), count); - - public static int ConsumeAllCraftableIngredients(this DrinkData data) - { - var ingredients = data.GetIngredients(); - int count = CraftingHelper.GetCraftableCount(ingredients); - return CraftingHelper.ConsumeAll(ingredients, count); - } - - public static void RefundIngredients(this DrinkData data, int count = 1) - => CraftingHelper.RefundIngredients(data.GetIngredients(), count); - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs b/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs deleted file mode 100644 index ddbf6f0e0..000000000 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; - -namespace DDD -{ - public static class FoodDataExtensions - { - public static List GetIngredients(this FoodData data) => CraftingHelper.ExtractIngredients( - data.IngredientKey1, data.IngredientAmount1, - data.IngredientKey2, data.IngredientAmount2, - data.IngredientKey3, data.IngredientAmount3, - data.IngredientKey4, data.IngredientAmount4 - ); - - public static List GetTasteDatas(this FoodData data) - => CraftingHelper.ResolveTasteDatas( - new[] { data.TasteKey1, data.TasteKey2, data.TasteKey3, data.TasteKey4, data.TasteKey5, data.TasteKey6 }, - DataManager.Instance.GetDataSo() - ); - - public static int GetCraftableCount(this FoodData data) - => CraftingHelper.GetCraftableCount(data.GetIngredients()); - - public static bool TryConsumeIngredients(this FoodData data, int count = 1) - => CraftingHelper.TryConsumeIngredients(data.GetIngredients(), count); - - public static int ConsumeAllCraftableIngredients(this FoodData data) - { - var ingredients = data.GetIngredients(); - int count = CraftingHelper.GetCraftableCount(ingredients); - return CraftingHelper.ConsumeAll(ingredients, count); - } - - public static void RefundIngredients(this FoodData data, int count = 1) - => CraftingHelper.RefundIngredients(data.GetIngredients(), count); - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CookwareDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CookwareDataAsset.asset new file mode 100644 index 000000000..aa9b3e191 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CookwareDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f7460f0acbac80d6e106b5a3b7ca458e14578783b5c277b7914a1417e3abc38 +size 1016 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CookwareDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CookwareDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CookwareDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CookwareDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerDataAsset.asset new file mode 100644 index 000000000..0b68d0f68 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fde6cef5464a2fd6832c0e2fad7c585618bb8bdf64fcc4b45f225aee7dd0ef35 +size 955 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerPoolDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerPoolDataAsset.asset new file mode 100644 index 000000000..1062e5434 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerPoolDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38e7e9974ded3d328cb0d7b8983b2f5427c053e3cde91963458c9e7bef9c657f +size 1319 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerPoolDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerPoolDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/DrinkDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/DrinkDataAsset.asset new file mode 100644 index 000000000..b42f24ce9 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/DrinkDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a52213a4b087efeafaecf64a08506ec7a7dc47261de27f851cb35f620d91991 +size 2215 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/DrinkDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/DrinkDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/DrinkDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/DrinkDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/EnvironmentDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/EnvironmentDataAsset.asset new file mode 100644 index 000000000..fb6ab7893 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/EnvironmentDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9966134fed81dd3e3f7175f430cc1bc3051f33c8e3f624ea6250b13382080d3 +size 1537 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/EnvironmentDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/EnvironmentDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/EnvironmentDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/EnvironmentDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/FoodDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/FoodDataAsset.asset new file mode 100644 index 000000000..a9119cd48 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/FoodDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c3e15e5cd97d76c812871adb467ca146e526d1705477e293b77683bdddf2cb6 +size 9435 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/FoodDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/FoodDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/FoodDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/FoodDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/IngredientDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/IngredientDataAsset.asset new file mode 100644 index 000000000..c4cb34349 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/IngredientDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42a66890241adfb9d9f0a90caee3db1557bf8c579641a24bbe90ac8b3282d35d +size 1453 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/IngredientDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/IngredientDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/IngredientDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/IngredientDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/ItemDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/ItemDataAsset.asset new file mode 100644 index 000000000..e5079a144 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/ItemDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad48880bc0769b0eed9efa2f55b970751e472b20408e69914ad2e596fc67b1d9 +size 5509 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/ItemDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/ItemDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/ItemDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/ItemDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/LevelDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/LevelDataAsset.asset new file mode 100644 index 000000000..7f0bcf560 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/LevelDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bd03372474b6d1e65c81112442a0e711ab17cfdaead841de59ec1690a8ec60a +size 2128 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/LevelDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/LevelDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/RecipeDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/RecipeDataAsset.asset new file mode 100644 index 000000000..f03e22201 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/RecipeDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21a37b6a7ab2bf63c99ee6dc0f623bb93ff8d14d48530fe35e9c1cdb3b2a2c28 +size 2726 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/RecipeDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/RecipeDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/RecipeDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/RecipeDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/TasteDataAsset.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/TasteDataAsset.asset new file mode 100644 index 000000000..259151841 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/TasteDataAsset.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad937bc3f4ebd929d825e7cea0815065459e05457a790e3fea23743ad33111a3 +size 1320 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/TasteDataSo.asset.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/TasteDataAsset.asset.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/TasteDataSo.asset.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/TasteDataAsset.asset.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/BackUps/2025-08-28 12-54-27 by 남태건.json b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/BackUps/2025-08-28 12-54-27 by 남태건.json new file mode 100644 index 000000000..dac8797c0 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/BackUps/2025-08-28 12-54-27 by 남태건.json @@ -0,0 +1,1759 @@ +{ + "$개요": [ + { + "": "Sweet" + }, + { + "": "Sour" + }, + { + "": "Bitter" + }, + { + "": "Salty" + }, + { + "": "SuperHot" + }, + { + "": "Savory" + }, + { + "": "Mild" + }, + { + "": "Warm" + }, + { + "": "Addictive" + }, + { + "": "Fish" + }, + { + "": "Vegetable" + }, + { + "": "Meat" + }, + { + "": "" + }, + { + "": "Soda" + }, + { + "": "MiddleDegree" + }, + { + "": "LowDegree" + }, + { + "": "NoneDegree" + }, + { + "": "WoodFlavor" + }, + { + "": "FruitFlavor" + } + ], + "Test": [ + { + "Id:string": "식별번호", + "CustomerLimitCount": "손님 최대 수", + "Customers:string": "등장 손님", + "Test": 2352, + "Tests": "" + }, + { + "Id:string": "customer_pool_001", + "CustomerLimitCount": 4, + "Customers:string": "customer_001", + "Test": 0, + "Tests": "테스트, 테스트2" + }, + { + "Id:string": "customer_pool_002", + "CustomerLimitCount": 7, + "Customers:string": "customer_001 | customer_002", + "Test": 3, + "Tests": "1 , 2" + }, + { + "Id:string": "customer_pool_003", + "CustomerLimitCount": 9, + "Customers:string": "customer_001 | customer_002 | customer_003", + "Test": 2, + "Tests": "5, 23,253" + }, + { + "Id:string": "customer_pool_004", + "CustomerLimitCount": 3, + "Customers:string": "customer_001", + "Test": "", + "Tests": "" + }, + { + "Id:string": "customer_pool_005", + "CustomerLimitCount": 3, + "Customers:string": "customer_001", + "Test": "", + "Tests": 435 + }, + { + "Id:string": "customer_pool_006", + "CustomerLimitCount": 3, + "Customers:string": "customer_001", + "Test": "", + "Tests": "" + }, + { + "Id:string": "special_customer_pool_001", + "CustomerLimitCount": 1, + "Customers:string": "special_customer_001", + "Test": "", + "Tests": "111|234" + } + ], + "Test_view": [ + { + "Id:string": "식별번호", + "CustomerLimitCount": "손님 최대 수", + "Customers1": "등장 손님1", + "Customers2": "등장 손님2", + "Customers3": "등장 손님3", + "Customers4": "등장 손님4", + "Customers5": "등장 손님5", + "Customers6": "등장 손님6", + "Test": 2352, + "Tests1": "Tests1", + "Tests2": "Tests2", + "Tests3": "Tests3" + }, + { + "Id:string": "customer_pool_001", + "CustomerLimitCount": 4, + "Customers1": "customer_001", + "Customers2": "", + "Customers3": "", + "Customers4": "", + "Customers5": "", + "Customers6": "", + "Test": 0, + "Tests1": "테스트", + "Tests2": "테스트2", + "Tests3": "" + }, + { + "Id:string": "customer_pool_002", + "CustomerLimitCount": 7, + "Customers1": "customer_001", + "Customers2": "customer_002", + "Customers3": "", + "Customers4": "", + "Customers5": "", + "Customers6": "", + "Test": 3, + "Tests1": 1, + "Tests2": 2, + "Tests3": "" + }, + { + "Id:string": "customer_pool_003", + "CustomerLimitCount": 9, + "Customers1": "customer_001", + "Customers2": "customer_002", + "Customers3": "customer_003", + "Customers4": "", + "Customers5": "", + "Customers6": "", + "Test": 2, + "Tests1": 5, + "Tests2": 23, + "Tests3": 253 + }, + { + "Id:string": "customer_pool_004", + "CustomerLimitCount": 3, + "Customers1": "customer_001", + "Customers2": "", + "Customers3": "", + "Customers4": "", + "Customers5": "", + "Customers6": "", + "Test": "", + "Tests1": "", + "Tests2": "", + "Tests3": "" + }, + { + "Id:string": "customer_pool_005", + "CustomerLimitCount": 3, + "Customers1": "customer_001", + "Customers2": "", + "Customers3": "", + "Customers4": "", + "Customers5": "", + "Customers6": "", + "Test": "", + "Tests1": 435, + "Tests2": "", + "Tests3": "" + }, + { + "Id:string": "customer_pool_006", + "CustomerLimitCount": 3, + "Customers1": "customer_001", + "Customers2": "", + "Customers3": "", + "Customers4": "", + "Customers5": "", + "Customers6": "", + "Test": "", + "Tests1": "", + "Tests2": "", + "Tests3": "" + }, + { + "Id:string": "special_customer_pool_001", + "CustomerLimitCount": 1, + "Customers1": "special_customer_001", + "Customers2": "", + "Customers3": "", + "Customers4": "", + "Customers5": "", + "Customers6": "", + "Test": "", + "Tests1": 111, + "Tests2": 234, + "Tests3": "" + } + ], + "LevelData": [ + { + "Id:string": "식별번호", + "Level": "레벨 or 평판", + "Area:string": "등장 지역", + "CustomerPool:string": "일반 손님 풀", + "SpecialCustomerPool:string": "스페셜 손님 풀", + "SpawnType:NativeEnum": "스폰 타입", + "CustomerRespawnTime": "손님 리스폰 시간", + "Exp": "손님 1명당 경험치", + "OrderTime": "주문 대기 인내심 카운트 시간", + "WaitTime": "주문 인내심 카운트 시간", + "EatingTime": "식사 소요시간" + }, + { + "Id:string": "Level001", + "Level": 1, + "Area:string": "Area1", + "CustomerPool:string": "customer_pool_001", + "SpecialCustomerPool:string": "", + "SpawnType:NativeEnum": "Random", + "CustomerRespawnTime": 6, + "Exp": 13, + "OrderTime": 30, + "WaitTime": 60, + "EatingTime": 6 + }, + { + "Id:string": "Level002", + "Level": 2, + "Area:string": "Area1", + "CustomerPool:string": "customer_pool_002", + "SpecialCustomerPool:string": "special_customer_pool_001", + "SpawnType:NativeEnum": "Random", + "CustomerRespawnTime": 6, + "Exp": 13, + "OrderTime": 30, + "WaitTime": 60, + "EatingTime": 6 + }, + { + "Id:string": "Level003", + "Level": 3, + "Area:string": "Area1", + "CustomerPool:string": "customer_pool_003", + "SpecialCustomerPool:string": "special_customer_pool_001", + "SpawnType:NativeEnum": "Regular", + "CustomerRespawnTime": 6, + "Exp": 13, + "OrderTime": 30, + "WaitTime": 60, + "EatingTime": 6 + }, + { + "Id:string": "Level004", + "Level": 4, + "Area:string": "Area2", + "CustomerPool:string": "customer_pool_004", + "SpecialCustomerPool:string": "special_customer_pool_001", + "SpawnType:NativeEnum": "Regular", + "CustomerRespawnTime": 6, + "Exp": 13, + "OrderTime": 30, + "WaitTime": 60, + "EatingTime": 6 + }, + { + "Id:string": "Level005", + "Level": 5, + "Area:string": "Area2", + "CustomerPool:string": "customer_pool_005", + "SpecialCustomerPool:string": "special_customer_pool_001", + "SpawnType:NativeEnum": "Regular", + "CustomerRespawnTime": 6, + "Exp": 13, + "OrderTime": 30, + "WaitTime": 60, + "EatingTime": 6 + }, + { + "Id:string": "Level006", + "Level": 6, + "Area:string": "Area2", + "CustomerPool:string": "customer_pool_006", + "SpecialCustomerPool:string": "special_customer_pool_001", + "SpawnType:NativeEnum": "Random", + "CustomerRespawnTime": 6, + "Exp": 13, + "OrderTime": 30, + "WaitTime": 60, + "EatingTime": 6 + } + ], + "CustomerData": [ + { + "Id:string": "식별번호", + "CustomerType:NativeEnum": "손님 타입", + "#Name": "이름", + "SpineSkinKey": "스파인 스킨 키 값", + "FavoriteTastes": "선호 맛들" + }, + { + "Id:string": "customer_001", + "CustomerType:NativeEnum": "Normal", + "#Name": "유령1", + "SpineSkinKey": "Casper", + "FavoriteTastes": "" + }, + { + "Id:string": "customer_002", + "CustomerType:NativeEnum": "Normal", + "#Name": "유령2", + "SpineSkinKey": "CasperBlack", + "FavoriteTastes": "" + }, + { + "Id:string": "customer_003", + "CustomerType:NativeEnum": "Normal", + "#Name": "유령3", + "SpineSkinKey": "PumkinHead", + "FavoriteTastes": "" + }, + { + "Id:string": "special_customer_001", + "CustomerType:NativeEnum": "Special", + "#Name": "차이", + "SpineSkinKey": "", + "FavoriteTastes": "" + } + ], + "CustomerPoolData": [ + { + "Id:string": "식별번호", + "CustomerLimitCount": "손님 최대 수", + "Customers:string": "등장 손님들" + }, + { + "Id:string": "customer_pool_001", + "CustomerLimitCount": 4, + "Customers:string": "customer_001" + }, + { + "Id:string": "customer_pool_002", + "CustomerLimitCount": 7, + "Customers:string": "customer_001, customer_002" + }, + { + "Id:string": "customer_pool_003", + "CustomerLimitCount": 9, + "Customers:string": "customer_001, customer_002, customer_003" + }, + { + "Id:string": "customer_pool_004", + "CustomerLimitCount": 3, + "Customers:string": "customer_001" + }, + { + "Id:string": "customer_pool_005", + "CustomerLimitCount": 3, + "Customers:string": "customer_001" + }, + { + "Id:string": "customer_pool_006", + "CustomerLimitCount": 3, + "Customers:string": "customer_001" + }, + { + "Id:string": "special_customer_pool_001", + "CustomerLimitCount": 1, + "Customers:string": "special_customer_001" + } + ], + "ItemData": [ + { + "Id": "식별번호", + "ItemType:NativeEnum": "아이템타입1" + }, + { + "Id": "item_food_001", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_002", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_003", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_004", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_005", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_006", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_007", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_008", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_009", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_010", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_011", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_012", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_013", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_014", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_015", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_016", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_017", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_018", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_019", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_food_020", + "ItemType:NativeEnum": "Food" + }, + { + "Id": "item_ingredient_001", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_002", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_003", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_004", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_005", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_006", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_007", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_008", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_009", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_010", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_011", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_012", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_013", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_014", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_015", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_016", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_017", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_018", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_019", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_020", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_021", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_022", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_ingredient_023", + "ItemType:NativeEnum": "Ingredient" + }, + { + "Id": "item_environment_001", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_002", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_003", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_004", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_005", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_001", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_002", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_003", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_004", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_005", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_006", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_007", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_environment_cookware_008", + "ItemType:NativeEnum": "Environment" + }, + { + "Id": "item_drink_001", + "ItemType:NativeEnum": "Drink" + }, + { + "Id": "item_drink_002", + "ItemType:NativeEnum": "Drink" + }, + { + "Id": "item_drink_003", + "ItemType:NativeEnum": "Drink" + }, + { + "Id": "item_drink_004", + "ItemType:NativeEnum": "Drink" + }, + { + "Id": "item_food_recipe_001", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_002", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_003", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_004", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_005", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_006", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_007", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_008", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_009", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_010", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_011", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_012", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_013", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_014", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_015", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_016", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_017", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_018", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_019", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_food_recipe_020", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_drink_recipe_001", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_drink_recipe_002", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_drink_recipe_003", + "ItemType:NativeEnum": "Recipe" + }, + { + "Id": "item_drink_recipe_004", + "ItemType:NativeEnum": "Recipe" + } + ], + "RecipeData": [ + { + "Id:string": "식별ID", + "#Name": "이름", + "RecipeType:NativeEnum": "레시피타입", + "RecipeResult:string": "완성 메뉴" + }, + { + "Id:string": "item_food_recipe_001", + "#Name": "블루 스튜 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_001" + }, + { + "Id:string": "item_food_recipe_002", + "#Name": "햇빛 스튜 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_002" + }, + { + "Id:string": "item_food_recipe_003", + "#Name": "심해기억 스튜 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_003" + }, + { + "Id:string": "item_food_recipe_004", + "#Name": "치킨 굴라쉬 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_004" + }, + { + "Id:string": "item_food_recipe_005", + "#Name": "꿈해초 크로켓 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_005" + }, + { + "Id:string": "item_food_recipe_006", + "#Name": "선라이즈 당근카츠 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_006" + }, + { + "Id:string": "item_food_recipe_007", + "#Name": "미정", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_007" + }, + { + "Id:string": "item_food_recipe_008", + "#Name": "비늘치킨덕 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_008" + }, + { + "Id:string": "item_food_recipe_009", + "#Name": "화룡장어 구이 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_009" + }, + { + "Id:string": "item_food_recipe_010", + "#Name": "미정", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_010" + }, + { + "Id:string": "item_food_recipe_011", + "#Name": "바다의선물 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_011" + }, + { + "Id:string": "item_food_recipe_012", + "#Name": "유령새우회 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_012" + }, + { + "Id:string": "item_food_recipe_013", + "#Name": "비늘초무침 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_013" + }, + { + "Id:string": "item_food_recipe_014", + "#Name": "쫀징어 냉채 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_014" + }, + { + "Id:string": "item_food_recipe_015", + "#Name": "쫀징어링 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_015" + }, + { + "Id:string": "item_food_recipe_016", + "#Name": "꿈해파리 볶음 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_016" + }, + { + "Id:string": "item_food_recipe_017", + "#Name": "페퍼포칼립스 레시피", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_017" + }, + { + "Id:string": "item_food_recipe_018", + "#Name": "미정", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_018" + }, + { + "Id:string": "item_food_recipe_019", + "#Name": "미정", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_019" + }, + { + "Id:string": "item_food_recipe_020", + "#Name": "미정", + "RecipeType:NativeEnum": "FoodRecipe", + "RecipeResult:string": "item_food_020" + }, + { + "Id:string": "item_drink_recipe_001", + "#Name": "토마토 주스 레시피", + "RecipeType:NativeEnum": "DrinkRecipe", + "RecipeResult:string": "item_drink_001" + }, + { + "Id:string": "item_drink_recipe_002", + "#Name": "오렌지 주스 레시피", + "RecipeType:NativeEnum": "DrinkRecipe", + "RecipeResult:string": "item_drink_002" + }, + { + "Id:string": "item_drink_recipe_003", + "#Name": "여신의눈물 레시피", + "RecipeType:NativeEnum": "DrinkRecipe", + "RecipeResult:string": "item_drink_003" + }, + { + "Id:string": "item_drink_recipe_004", + "#Name": "라벨블루 레시피", + "RecipeType:NativeEnum": "DrinkRecipe", + "RecipeResult:string": "item_drink_004" + } + ], + "FoodData": [ + { + "Id:string": "식별ID", + "#Name": "이름", + "CookwareKey:string": "요리도구 키 값", + "CookTime:int": "요리시간", + "Price:int": "요리가격", + "IngredientKey1:string": "재료1", + "IngredientAmount1:string": "재료1 갯수", + "IngredientKey2:string": "재료2", + "IngredientAmount2:string": "재료2 갯수", + "IngredientKey3:string": "재료3", + "IngredientAmount3:string": "재료3 갯수", + "IngredientKey4:string": "재료4", + "IngredientAmount4:string": "재료4 갯수", + "TasteKey1:string": "맛 키1", + "TasteKey2:string": "맛 키2", + "TasteKey3:string": "맛 키3", + "TasteKey4:string": "맛 키4", + "TasteKey5:string": "맛 키5", + "TasteKey6:string": "맛 키6" + }, + { + "Id:string": "item_food_001", + "#Name": "블루 스튜", + "CookwareKey:string": "item_environment_cookware_001", + "CookTime:int": 7, + "Price:int": 10, + "IngredientKey1:string": "item_ingredient_001", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_002", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Sweet", + "TasteKey2:string": "Warm", + "TasteKey3:string": "Vegetable", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_002", + "#Name": "햇빛 스튜", + "CookwareKey:string": "item_environment_cookware_001", + "CookTime:int": 7, + "Price:int": 20, + "IngredientKey1:string": "item_ingredient_002", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_003", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Sweet", + "TasteKey2:string": "Bitter", + "TasteKey3:string": "Warm", + "TasteKey4:string": "Vegetable", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_003", + "#Name": "심해기억 스튜", + "CookwareKey:string": "item_environment_cookware_001", + "CookTime:int": 7, + "Price:int": 15, + "IngredientKey1:string": "item_ingredient_002", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_004", + "IngredientAmount2:string": 2, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Salty", + "TasteKey2:string": "Mild", + "TasteKey3:string": "Vegetable", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_004", + "#Name": "치킨 굴라쉬", + "CookwareKey:string": "item_environment_cookware_001", + "CookTime:int": 10, + "Price:int": 30, + "IngredientKey1:string": "item_ingredient_005", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_006", + "IngredientAmount2:string": 2, + "IngredientKey3:string": "item_ingredient_007", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Salty", + "TasteKey2:string": "Sweet", + "TasteKey3:string": "Addictive", + "TasteKey4:string": "Vegetable", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_005", + "#Name": "꿈해초 크로켓", + "CookwareKey:string": "item_environment_cookware_002", + "CookTime:int": 5, + "Price:int": 20, + "IngredientKey1:string": "item_ingredient_007", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_008", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "item_ingredient_009", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Sour", + "TasteKey2:string": "Salty", + "TasteKey3:string": "Mild", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_006", + "#Name": "선라이즈 당근카츠", + "CookwareKey:string": "item_environment_cookware_002", + "CookTime:int": 5, + "Price:int": 30, + "IngredientKey1:string": "item_ingredient_003", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_007", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "item_ingredient_009", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "item_ingredient_010", + "IngredientAmount4:string": 1, + "TasteKey1:string": "Sweet", + "TasteKey2:string": "Sour", + "TasteKey3:string": "Warm", + "TasteKey4:string": "Savory", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_007", + "#Name": "미정", + "CookwareKey:string": "item_environment_cookware_002", + "CookTime:int": 5, + "Price:int": 30, + "IngredientKey1:string": "item_ingredient_011", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_008", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "", + "TasteKey2:string": "", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_008", + "#Name": "비늘치킨덕", + "CookwareKey:string": "item_environment_cookware_003", + "CookTime:int": 6, + "Price:int": 30, + "IngredientKey1:string": "item_ingredient_012", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_013", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "item_ingredient_007", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Salty", + "TasteKey2:string": "Mild", + "TasteKey3:string": "Addictive", + "TasteKey4:string": "Meat", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_009", + "#Name": "화룡장어 구이", + "CookwareKey:string": "item_environment_cookware_003", + "CookTime:int": 6, + "Price:int": 15, + "IngredientKey1:string": "item_ingredient_014", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_015", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Sweet", + "TasteKey2:string": "Mild", + "TasteKey3:string": "SuperHot", + "TasteKey4:string": "Fish", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_010", + "#Name": "미정", + "CookwareKey:string": "item_environment_cookware_003", + "CookTime:int": 6, + "Price:int": 30, + "IngredientKey1:string": "item_ingredient_016", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_008", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "", + "TasteKey2:string": "", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_011", + "#Name": "바다의선물", + "CookwareKey:string": "item_environment_cookware_004", + "CookTime:int": 5, + "Price:int": 10, + "IngredientKey1:string": "item_ingredient_002", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_003", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Sweet", + "TasteKey2:string": "Mild", + "TasteKey3:string": "Vegetable", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_012", + "#Name": "유령새우회", + "CookwareKey:string": "item_environment_cookware_004", + "CookTime:int": 5, + "Price:int": 25, + "IngredientKey1:string": "item_ingredient_017", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_007", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "item_ingredient_004", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Sweet", + "TasteKey2:string": "Salty", + "TasteKey3:string": "Addictive", + "TasteKey4:string": "Fish", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_013", + "#Name": "비늘초무침", + "CookwareKey:string": "item_environment_cookware_004", + "CookTime:int": 5, + "Price:int": 45, + "IngredientKey1:string": "item_ingredient_018", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_003", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "item_ingredient_007", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "item_ingredient_010", + "IngredientAmount4:string": 2, + "TasteKey1:string": "Salty", + "TasteKey2:string": "Sour", + "TasteKey3:string": "Mild", + "TasteKey4:string": "Vegetable", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_014", + "#Name": "쫀징어 냉채", + "CookwareKey:string": "item_environment_cookware_004", + "CookTime:int": 5, + "Price:int": 15, + "IngredientKey1:string": "item_ingredient_011", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_003", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Salty", + "TasteKey2:string": "Vegetable", + "TasteKey3:string": "Fish", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_015", + "#Name": "쫀징어링", + "CookwareKey:string": "item_environment_cookware_005", + "CookTime:int": 8, + "Price:int": 25, + "IngredientKey1:string": "item_ingredient_011", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_007", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "item_ingredient_015", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Salty", + "TasteKey2:string": "Sour", + "TasteKey3:string": "SuperHot", + "TasteKey4:string": "Fish", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_016", + "#Name": "꿈해파리 볶음", + "CookwareKey:string": "item_environment_cookware_005", + "CookTime:int": 6, + "Price:int": 15, + "IngredientKey1:string": "item_ingredient_019", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_004", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Salty", + "TasteKey2:string": "Sweet", + "TasteKey3:string": "Sour", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_017", + "#Name": "페퍼포칼립스", + "CookwareKey:string": "item_environment_cookware_005", + "CookTime:int": 6, + "Price:int": 25, + "IngredientKey1:string": "item_ingredient_012", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_015", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "item_ingredient_008", + "IngredientAmount3:string": 1, + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "Sweet", + "TasteKey2:string": "SuperHot", + "TasteKey3:string": "Meat", + "TasteKey4:string": "Vegetable", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_018", + "#Name": "미정", + "CookwareKey:string": "item_environment_cookware_006", + "CookTime:int": 0, + "Price:int": 0, + "IngredientKey1:string": "", + "IngredientAmount1:string": "", + "IngredientKey2:string": "", + "IngredientAmount2:string": "", + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "", + "TasteKey2:string": "", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_019", + "#Name": "미정", + "CookwareKey:string": "item_environment_cookware_006", + "CookTime:int": 0, + "Price:int": 0, + "IngredientKey1:string": "", + "IngredientAmount1:string": "", + "IngredientKey2:string": "", + "IngredientAmount2:string": "", + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "", + "TasteKey2:string": "", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_food_020", + "#Name": "미정", + "CookwareKey:string": "item_environment_cookware_006", + "CookTime:int": 0, + "Price:int": 0, + "IngredientKey1:string": "", + "IngredientAmount1:string": "", + "IngredientKey2:string": "", + "IngredientAmount2:string": "", + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "", + "TasteKey2:string": "", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + } + ], + "DrinkData": [ + { + "Id:string": "식별ID", + "#Name": "이름", + "CookwareKey:string": "요리도구 키 값", + "CookTime:int": "요리시간", + "Price:int": "요리가격", + "IngredientKey1:string": "재료1", + "IngredientAmount1:string": "재료1 갯수", + "IngredientKey2:string": "재료2", + "IngredientAmount2:string": "재료2 갯수", + "IngredientKey3:string": "재료3", + "IngredientAmount3:string": "재료3 갯수", + "IngredientKey4:string": "재료4", + "IngredientAmount4:string": "재료4 갯수", + "TasteKey1:string": "맛 키1", + "TasteKey2:string": "맛 키2", + "TasteKey3:string": "맛 키3", + "TasteKey4:string": "맛 키4", + "TasteKey5:string": "맛 키5", + "TasteKey6:string": "맛 키6" + }, + { + "Id:string": "item_drink_001", + "#Name": "토마토 주스", + "CookwareKey:string": "item_environment_cookware_007", + "CookTime:int": 1, + "Price:int": 10, + "IngredientKey1:string": "item_ingredient_006", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_021", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "NoneDegree", + "TasteKey2:string": "Soda", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_drink_002", + "#Name": "오렌지 주스", + "CookwareKey:string": "item_environment_cookware_007", + "CookTime:int": 1, + "Price:int": 10, + "IngredientKey1:string": "item_ingredient_023", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_021", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "NoneDegree", + "TasteKey2:string": "Sour", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_drink_003", + "#Name": "여신의눈물", + "CookwareKey:string": "item_environment_cookware_008", + "CookTime:int": 3, + "Price:int": 10, + "IngredientKey1:string": "item_ingredient_008", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_022", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "LowDegree", + "TasteKey2:string": "WoodFlavor", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + }, + { + "Id:string": "item_drink_004", + "#Name": "라벨블루", + "CookwareKey:string": "item_environment_cookware_008", + "CookTime:int": 3, + "Price:int": 10, + "IngredientKey1:string": "item_ingredient_002", + "IngredientAmount1:string": 1, + "IngredientKey2:string": "item_ingredient_022", + "IngredientAmount2:string": 1, + "IngredientKey3:string": "", + "IngredientAmount3:string": "", + "IngredientKey4:string": "", + "IngredientAmount4:string": "", + "TasteKey1:string": "MiddleDegree", + "TasteKey2:string": "FruitFlavor", + "TasteKey3:string": "", + "TasteKey4:string": "", + "TasteKey5:string": "", + "TasteKey6:string": "" + } + ], + "IngredientData": [ + { + "Id:string": "식별ID", + "#Name": "이름" + }, + { + "Id:string": "item_ingredient_001", + "#Name": "극락쌀" + }, + { + "Id:string": "item_ingredient_002", + "#Name": "블루애플" + }, + { + "Id:string": "item_ingredient_003", + "#Name": "햇빛당근" + }, + { + "Id:string": "item_ingredient_004", + "#Name": "꿈꾸는 해초" + }, + { + "Id:string": "item_ingredient_005", + "#Name": "미정" + }, + { + "Id:string": "item_ingredient_006", + "#Name": "토마토" + }, + { + "Id:string": "item_ingredient_007", + "#Name": "천일염" + }, + { + "Id:string": "item_ingredient_008", + "#Name": "눈물" + }, + { + "Id:string": "item_ingredient_009", + "#Name": "밀가루" + }, + { + "Id:string": "item_ingredient_010", + "#Name": "식초" + }, + { + "Id:string": "item_ingredient_011", + "#Name": "쫀징어" + }, + { + "Id:string": "item_ingredient_012", + "#Name": "치타닭 고기 " + }, + { + "Id:string": "item_ingredient_013", + "#Name": "비늘오리 고기" + }, + { + "Id:string": "item_ingredient_014", + "#Name": "뱀장어" + }, + { + "Id:string": "item_ingredient_015", + "#Name": "불꽃 고추" + }, + { + "Id:string": "item_ingredient_016", + "#Name": "유령상어" + }, + { + "Id:string": "item_ingredient_017", + "#Name": "유령새우" + }, + { + "Id:string": "item_ingredient_018", + "#Name": "비늘발고둥" + }, + { + "Id:string": "item_ingredient_019", + "#Name": "홍해파리" + }, + { + "Id:string": "item_ingredient_020", + "#Name": "미정" + }, + { + "Id:string": "item_ingredient_021", + "#Name": "탄산수" + }, + { + "Id:string": "item_ingredient_022", + "#Name": "위스키" + }, + { + "Id:string": "item_ingredient_023", + "#Name": "오렌지" + } + ], + "CookwareData": [ + { + "Id:string": "식별ID", + "#Name": "이름", + "CookwareType:NativeEnum": "요리도구 타입" + }, + { + "Id:string": "item_environment_cookware_001", + "#Name": "냄비", + "CookwareType:NativeEnum": "Pot" + }, + { + "Id:string": "item_environment_cookware_002", + "#Name": "튀김", + "CookwareType:NativeEnum": "Fryer" + }, + { + "Id:string": "item_environment_cookware_003", + "#Name": "화로", + "CookwareType:NativeEnum": "Brazier" + }, + { + "Id:string": "item_environment_cookware_004", + "#Name": "", + "CookwareType:NativeEnum": "CuttingBoard" + }, + { + "Id:string": "item_environment_cookware_005", + "#Name": "", + "CookwareType:NativeEnum": "Griddle" + }, + { + "Id:string": "item_environment_cookware_006", + "#Name": "", + "CookwareType:NativeEnum": "MagicOven" + }, + { + "Id:string": "item_environment_cookware_007", + "#Name": "", + "CookwareType:NativeEnum": "JuiceMachine" + }, + { + "Id:string": "item_environment_cookware_008", + "#Name": "", + "CookwareType:NativeEnum": "Barrel" + } + ], + "TasteData": [ + { + "Id:string": "식별ID", + "#Name": "이름", + "TasteType:NativeEnum": "맛 종류" + }, + { + "Id:string": "Sweet", + "#Name": "단맛", + "TasteType:NativeEnum": "Sweet" + }, + { + "Id:string": "Warm", + "#Name": "따뜻한", + "TasteType:NativeEnum": "Warm" + }, + { + "Id:string": "Vegetable", + "#Name": "채류", + "TasteType:NativeEnum": "Vegetable" + }, + { + "Id:string": "Bitter", + "#Name": "쓴맛", + "TasteType:NativeEnum": "Bitter" + }, + { + "Id:string": "Salty", + "#Name": "짠맛", + "TasteType:NativeEnum": "Salty" + }, + { + "Id:string": "Mild", + "#Name": "담백한", + "TasteType:NativeEnum": "Mild" + }, + { + "Id:string": "Addictive", + "#Name": "중독적인", + "TasteType:NativeEnum": "Addictive" + }, + { + "Id:string": "Sour", + "#Name": "신맛", + "TasteType:NativeEnum": "Sour" + }, + { + "Id:string": "Savory", + "#Name": "고소한", + "TasteType:NativeEnum": "Savory" + }, + { + "Id:string": "Meat", + "#Name": "육류", + "TasteType:NativeEnum": "Meat" + }, + { + "Id:string": "SuperHot", + "#Name": "핵불닭맛", + "TasteType:NativeEnum": "SuperHot" + }, + { + "Id:string": "Fish", + "#Name": "어류", + "TasteType:NativeEnum": "Fish" + }, + { + "Id:string": "NoneDegree", + "#Name": "도수가없는", + "TasteType:NativeEnum": "NoneDegree" + }, + { + "Id:string": "Soda", + "#Name": "탄산", + "TasteType:NativeEnum": "Soda" + }, + { + "Id:string": "LowDegree", + "#Name": "도수가낮은", + "TasteType:NativeEnum": "LowDegree" + }, + { + "Id:string": "WoodFlavor", + "#Name": "나무향", + "TasteType:NativeEnum": "WoodFlavor" + }, + { + "Id:string": "MiddleDegree", + "#Name": "도수가보통인", + "TasteType:NativeEnum": "MiddleDegree" + }, + { + "Id:string": "FruitFlavor", + "#Name": "과일향", + "TasteType:NativeEnum": "FruitFlavor" + } + ], + "EnvironmentData": [ + { + "Id": "식별번호", + "InteractionType:NativeEnum": "인터랙션타입", + "RendererType:Enum": "렌더러 타입", + "IsTrigger:int": "트리거 여부", + "SkeletonDataName:string": "스켈레톤 애니메이션 에셋 이름", + "SkinName:string": "스파인 스킨 이름", + "DefaultAnimationName:string": "", + "SpriteKey:string": "SpriteAtlas 키 값", + "Size:float": "유니티 내의 이미지 크기" + }, + { + "Id": "item_environment_001", + "InteractionType:NativeEnum": "None", + "RendererType:Enum": "Sprite", + "IsTrigger:int": 0, + "SkeletonDataName:string": "", + "SkinName:string": "", + "DefaultAnimationName:string": "", + "SpriteKey:string": "Barrel01", + "Size:float": 1 + }, + { + "Id": "item_environment_002", + "InteractionType:NativeEnum": "None", + "RendererType:Enum": "Spine", + "IsTrigger:int": 1, + "SkeletonDataName:string": "Coral_SkeletonData", + "SkinName:string": "Coral01", + "DefaultAnimationName:string": "Coral01/Idle", + "SpriteKey:string": "", + "Size:float": 1 + }, + { + "Id": "item_environment_003", + "InteractionType:NativeEnum": "None", + "RendererType:Enum": "Spine", + "IsTrigger:int": 1, + "SkeletonDataName:string": "Coral_SkeletonData", + "SkinName:string": "Coral02", + "DefaultAnimationName:string": "Coral02/Idle", + "SpriteKey:string": "", + "Size:float": 1 + }, + { + "Id": "item_environment_004", + "InteractionType:NativeEnum": "None", + "RendererType:Enum": "Spine", + "IsTrigger:int": 1, + "SkeletonDataName:string": "SummerGrass01_SkeletonData", + "SkinName:string": "default", + "DefaultAnimationName:string": "Normal", + "SpriteKey:string": "", + "Size:float": 0.3 + }, + { + "Id": "item_environment_005", + "InteractionType:NativeEnum": "RestaurantManagement", + "RendererType:Enum": "Spine", + "IsTrigger:int": 0, + "SkeletonDataName:string": "", + "SkinName:string": "", + "DefaultAnimationName:string": "", + "SpriteKey:string": "", + "Size:float": 1 + } + ] +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/BackUps/2025-08-28 12-54-27 by 남태건.json.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/BackUps/2025-08-28 12-54-27 by 남태건.json.meta new file mode 100644 index 000000000..1628462d3 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/BackUps/2025-08-28 12-54-27 by 남태건.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 90984e9ede7c85d45b0883295d7cff8a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataAsset.cs new file mode 100644 index 000000000..aeae02f52 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataAsset.cs @@ -0,0 +1,23 @@ +// File: CookwareDataAsset.cs +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "CookwareDataAsset", menuName = "GoogleSheet/CookwareDataAsset")] + public class CookwareDataAsset : DataAsset + { + public bool TryGetValueByCookwareType(CookwareType cookwareType, out CookwareDataEntry cookwareDataEntry) + { + if (_datas == null) + { + cookwareDataEntry = null; + return false; + } + + cookwareDataEntry = _datas.FirstOrDefault(data => data != null && data.CookwareType == cookwareType); + return cookwareDataEntry != null; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataEntry.cs similarity index 93% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataEntry.cs index d3e784c00..52afff5e3 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataEntry.cs @@ -18,7 +18,7 @@ public enum CookwareType } [Serializable] - public class CookwareData : IId + public class CookwareDataEntry : IId { /// 식별ID [Tooltip("식별ID")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataSo.cs deleted file mode 100644 index 44f684862..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CookwareDataSo.cs +++ /dev/null @@ -1,23 +0,0 @@ -// File: CookwareDataSo.cs -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "CookwareDataSo", menuName = "GoogleSheet/CookwareDataSo")] - public class CookwareDataSo : DataSo - { - public bool TryGetValueByCookwareType(CookwareType cookwareType, out CookwareData cookwareData) - { - if (_datas == null) - { - cookwareData = null; - return false; - } - - cookwareData = _datas.FirstOrDefault(data => data != null && data.CookwareType == cookwareType); - return cookwareData != null; - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataAsset.cs similarity index 68% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataSo.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataAsset.cs index ae0f0fb50..5fdf7b797 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataSo.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataAsset.cs @@ -3,8 +3,8 @@ namespace DDD { - [CreateAssetMenu(fileName = "CustomerDataSo", menuName = "GoogleSheet/CustomerDataSo")] - public class CustomerDataSo : DataSo + [CreateAssetMenu(fileName = "CustomerDataAsset", menuName = "GoogleSheet/CustomerDataAsset")] + public class CustomerDataAsset : DataAsset { protected override void Initialize() { diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataEntry.cs similarity index 95% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataEntry.cs index a79054176..0a4d39d8e 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataEntry.cs @@ -15,7 +15,7 @@ public enum CustomerType } [Serializable] - public class CustomerData : IId + public class CustomerDataEntry : IId { /// 식별번호 [Tooltip("식별번호")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataAsset.cs similarity index 66% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataSo.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataAsset.cs index 076134084..c5bf87263 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataSo.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataAsset.cs @@ -3,8 +3,8 @@ namespace DDD { - [CreateAssetMenu(fileName = "CustomerPoolDataSo", menuName = "GoogleSheet/CustomerPoolDataSo")] - public class CustomerPoolDataSo : DataSo + [CreateAssetMenu(fileName = "CustomerPoolDataAsset", menuName = "GoogleSheet/CustomerPoolDataAsset")] + public class CustomerPoolDataAsset : DataAsset { protected override void Initialize() { diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataEntry.cs similarity index 93% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataEntry.cs index 4ef4e3531..7340799c1 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataEntry.cs @@ -7,7 +7,7 @@ namespace DDD { [Serializable] - public class CustomerPoolData : IId + public class CustomerPoolDataEntry : IId { /// 식별번호 [Tooltip("식별번호")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/CustomerPoolDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataAsset.cs new file mode 100644 index 000000000..ee717ac6b --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataAsset.cs @@ -0,0 +1,9 @@ +// File: DrinkDataAsset.cs +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "DrinkDataAsset", menuName = "GoogleSheet/DrinkDataAsset")] + public class DrinkDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataEntry.cs similarity index 98% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataEntry.cs index ce18e5dce..0c06242bc 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataEntry.cs @@ -5,7 +5,7 @@ namespace DDD { [Serializable] - public class DrinkData : IId + public class DrinkDataEntry : IId { /// 식별ID [Tooltip("식별ID")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataSo.cs deleted file mode 100644 index 5e175481c..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/DrinkDataSo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// File: DrinkDataSo.cs -using System.Collections.Generic; -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "DrinkDataSo", menuName = "GoogleSheet/DrinkDataSo")] - public class DrinkDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataAsset.cs new file mode 100644 index 000000000..18811836a --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataAsset.cs @@ -0,0 +1,9 @@ +// File: EnvironmentDataAsset.cs +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "EnvironmentDataAsset", menuName = "GoogleSheet/EnvironmentDataAsset")] + public class EnvironmentDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataEntry.cs similarity index 96% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataEntry.cs index 7bcae5499..ed32a019a 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataEntry.cs @@ -12,7 +12,7 @@ public enum RendererType } [Serializable] - public class EnvironmentData : IId + public class EnvironmentDataEntry : IId { /// 식별번호 [Tooltip("식별번호")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataSo.cs deleted file mode 100644 index aa5d3207e..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/EnvironmentDataSo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// File: EnvironmentDataSo.cs -using System.Collections.Generic; -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "EnvironmentDataSo", menuName = "GoogleSheet/EnvironmentDataSo")] - public class EnvironmentDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataAsset.cs new file mode 100644 index 000000000..a6b3a54aa --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataAsset.cs @@ -0,0 +1,9 @@ +// File: FoodDataAsset.cs +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "FoodDataAsset", menuName = "GoogleSheet/FoodDataAsset")] + public class FoodDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataEntry.cs similarity index 98% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataEntry.cs index a8f5aecef..48cc24417 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataEntry.cs @@ -5,7 +5,7 @@ namespace DDD { [Serializable] - public class FoodData : IId + public class FoodDataEntry : IId { /// 식별ID [Tooltip("식별ID")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataSo.cs deleted file mode 100644 index 3178bd192..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/FoodDataSo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// File: FoodDataSo.cs -using System.Collections.Generic; -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "FoodDataSo", menuName = "GoogleSheet/FoodDataSo")] - public class FoodDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataAsset.cs new file mode 100644 index 000000000..37884cbee --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataAsset.cs @@ -0,0 +1,8 @@ +// +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "IngredientDataAsset", menuName = "GoogleSheet/IngredientDataAsset")] + public class IngredientDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataEntry.cs similarity index 85% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataEntry.cs index ea776715a..90546185b 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataEntry.cs @@ -5,7 +5,7 @@ namespace DDD { [Serializable] - public class IngredientData : IId + public class IngredientDataEntry : IId { /// 식별ID [Tooltip("식별ID")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataSo.cs deleted file mode 100644 index dda2cd047..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/IngredientDataSo.cs +++ /dev/null @@ -1,8 +0,0 @@ -// -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "IngredientDataSo", menuName = "GoogleSheet/IngredientDataSo")] - public class IngredientDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataAsset.cs new file mode 100644 index 000000000..aab668034 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataAsset.cs @@ -0,0 +1,9 @@ +// File: ItemDataAsset.cs +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "ItemDataAsset", menuName = "GoogleSheet/ItemDataAsset")] + public class ItemDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataEntry.cs similarity index 93% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataEntry.cs index d4b5ba409..0681a2d51 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataEntry.cs @@ -15,7 +15,7 @@ public enum ItemType } [Serializable] - public class ItemData : IId + public class ItemDataEntry : IId { /// 식별번호 [Tooltip("식별번호")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataSo.cs deleted file mode 100644 index c4183a6a6..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/ItemDataSo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// File: ItemDataSo.cs -using System.Collections.Generic; -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "ItemDataSo", menuName = "GoogleSheet/ItemDataSo")] - public class ItemDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataAsset.cs new file mode 100644 index 000000000..cd57091b7 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataAsset.cs @@ -0,0 +1,8 @@ +// +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "LevelDataAsset", menuName = "GoogleSheet/LevelDataAsset")] + public class LevelDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataEntry.cs similarity index 97% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataEntry.cs index ab2cbf1fa..4a9793af4 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataEntry.cs @@ -12,7 +12,7 @@ public enum SpawnType } [Serializable] - public class LevelData : IId + public class LevelDataEntry : IId { /// 식별번호 [Tooltip("식별번호")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataSo.cs deleted file mode 100644 index 6f175d75d..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/LevelDataSo.cs +++ /dev/null @@ -1,8 +0,0 @@ -// -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "LevelDataSo", menuName = "GoogleSheet/LevelDataSo")] - public class LevelDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataAsset.cs new file mode 100644 index 000000000..26ced1dbf --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataAsset.cs @@ -0,0 +1,9 @@ +// File: RecipeDataAsset.cs +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "RecipeDataAsset", menuName = "GoogleSheet/RecipeDataAsset")] + public class RecipeDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataEntry.cs similarity index 93% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataEntry.cs index a38afbd14..43ed11ea3 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataEntry.cs @@ -12,7 +12,7 @@ public enum RecipeType } [Serializable] - public class RecipeData : IId + public class RecipeDataEntry : IId { /// 식별ID [Tooltip("식별ID")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataSo.cs deleted file mode 100644 index d82950b45..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/RecipeDataSo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// File: RecipeDataSo.cs -using System.Collections.Generic; -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "RecipeDataSo", menuName = "GoogleSheet/RecipeDataSo")] - public class RecipeDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataAsset.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataAsset.cs new file mode 100644 index 000000000..077402fd0 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataAsset.cs @@ -0,0 +1,9 @@ +// File: TasteDataAsset.cs +using System.Collections.Generic; +using UnityEngine; + +namespace DDD +{ + [CreateAssetMenu(fileName = "TasteDataAsset", menuName = "GoogleSheet/TasteDataAsset")] + public class TasteDataAsset : DataAsset { } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataSo.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataAsset.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataSo.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataAsset.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteData.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataEntry.cs similarity index 95% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteData.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataEntry.cs index 835cfe2e3..eb7b845fd 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteData.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataEntry.cs @@ -28,7 +28,7 @@ public enum TasteType } [Serializable] - public class TasteData : IId + public class TasteDataEntry : IId { /// 식별ID [Tooltip("식별ID")] diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteData.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteData.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataSo.cs deleted file mode 100644 index 538f8533d..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Classes/TasteDataSo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// File: TasteDataSo.cs -using System.Collections.Generic; -using UnityEngine; - -namespace DDD -{ - [CreateAssetMenu(fileName = "TasteDataSo", menuName = "GoogleSheet/TasteDataSo")] - public class TasteDataSo : DataSo { } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Logs/GoogleSheetChangeLog.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Logs/GoogleSheetChangeLog.asset index 77ef4281d..6c64975f1 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Logs/GoogleSheetChangeLog.asset +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Logs/GoogleSheetChangeLog.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a9bb03d45aa641d701bc2d8e978c6a353363fed2f8206bfd8ee5af63f9562cfc -size 736720 +oid sha256:28d20f9975e930a18df709d51f658df25780b25916edbd86478c68fb74446494 +size 797466 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CookwareDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CookwareDataSo.asset deleted file mode 100644 index e78767be5..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CookwareDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:38b93c1a21f0361c1e0bb154afdc0a0d9103225195b9f0cedd26e74de126eb3f -size 1013 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset deleted file mode 100644 index 4f596e43f..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:600b73b988d57a63d502145ba01feb5323df6b87ca7af17b795f220d5644019d -size 952 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset deleted file mode 100644 index 2a1e06063..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:744e0087510d2c2d522b5f894d684df478acfae5456ec547157af0c662c018f5 -size 1316 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/DrinkDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/DrinkDataSo.asset deleted file mode 100644 index 0373fbe90..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/DrinkDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3dfdc5570d516edbb7436c74cd98e4c4722fd4691afab34ba094b93a041dc2f9 -size 2212 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/EnvironmentDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/EnvironmentDataSo.asset deleted file mode 100644 index 98082d99f..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/EnvironmentDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:12badc6747a2bc25c321281b29f30d2397cd92a81d87cabed61151c0fb1a65bb -size 1534 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/FoodDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/FoodDataSo.asset deleted file mode 100644 index 31da407d7..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/FoodDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:12ddf4f70c6d37a1fb65c09de7281602c7d70f99255e3fe5d7aa198f6b829810 -size 9432 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/IngredientDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/IngredientDataSo.asset deleted file mode 100644 index a916baa64..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/IngredientDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:32cb5468e3b617ba50526c12255e072cfa8d658c73800a32a4ac852a37307f51 -size 1450 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/ItemDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/ItemDataSo.asset deleted file mode 100644 index 0cb1025ce..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/ItemDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6e75e05c2ca952b82d8b3204ebcd86ac4459c4d4a06b311a4ee99ebb8a39605e -size 5506 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset deleted file mode 100644 index 7db412a21..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:563078d8747c408ee7fd6442914fe4c071effe4ed8fcd1782cd9ddfbffb3890b -size 2125 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/RecipeDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/RecipeDataSo.asset deleted file mode 100644 index 1739578ea..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/RecipeDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cfb22ca245534fdd789d910626dd295eb2eb7abdbedfcb62c8927bdec52a8e79 -size 2723 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/TasteDataSo.asset b/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/TasteDataSo.asset deleted file mode 100644 index afe417bbc..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/TasteDataSo.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d408dbe2e5bfcf05f5cb6c69620258d694b22a6924be0c1b90343908907b47f0 -size 1317 diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/CodeGeneration/CSharpCodeGenerator.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/CodeGeneration/CSharpCodeGenerator.cs index cbb43e4f0..4fbace293 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/CodeGeneration/CSharpCodeGenerator.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/CodeGeneration/CSharpCodeGenerator.cs @@ -83,8 +83,8 @@ public CodeGenerationResult Generate(string fullJson, IReadOnlyCollection {{ }} + [CreateAssetMenu(fileName = ""{safe}Asset"", menuName = ""GoogleSheet/{safe}Asset"")] + public class {safe}Asset : DataAsset<{safe}> {{ }} }}"; } @@ -193,7 +193,7 @@ private string GenerateDataClass(string rootNamespace, string className, JArray sb.AppendLine($"namespace {rootNamespace}"); sb.AppendLine("{"); sb.AppendLine(" [Serializable]"); - sb.AppendLine($" public class {safeClass} : IId"); + sb.AppendLine($" public class {safeClass}Entry : IId"); sb.AppendLine(" {"); foreach (var prop in sampleRow.Properties()) diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/SoSynchronizer.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/AssetSynchronizer.cs similarity index 63% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/SoSynchronizer.cs rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/AssetSynchronizer.cs index e87b903ff..4e6f7034d 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/SoSynchronizer.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/AssetSynchronizer.cs @@ -10,15 +10,15 @@ namespace DDD { - public sealed class SoSynchronizer : ISoSynchronizer + public sealed class AssetSynchronizer : IAssetSynchronizer { private readonly IValueConverterRegistry _converter; private readonly List _updatedPaths = new(); - public IReadOnlyList UpdatedSoAssetPaths => _updatedPaths; + public IReadOnlyList AssetUpdatedAssetPaths => _updatedPaths; - public SoSynchronizer(IValueConverterRegistry converter) => _converter = converter; + public AssetSynchronizer(IValueConverterRegistry converter) => _converter = converter; - public bool SynchronizeAll(string fullJson, IReadOnlyCollection selectedSheets, string rootNamespace, string soFolderAssetPath) + public bool SynchronizeAll(string fullJson, IReadOnlyCollection selectedSheets, string rootNamespace, string assetFolderAssetPath) { _updatedPaths.Clear(); if (string.IsNullOrEmpty(fullJson)) return false; @@ -27,8 +27,8 @@ public bool SynchronizeAll(string fullJson, IReadOnlyCollection selected bool allSuccess = true; // 폴더 보장 - if (!AssetDatabase.IsValidFolder(soFolderAssetPath)) - CreateFolderRecursive(soFolderAssetPath); + if (!AssetDatabase.IsValidFolder(assetFolderAssetPath)) + CreateFolderRecursive(assetFolderAssetPath); // 타입 캐시 var types = AppDomain.CurrentDomain.GetAssemblies() @@ -40,38 +40,38 @@ public bool SynchronizeAll(string fullJson, IReadOnlyCollection selected .GroupBy(t => t.Name) .ToDictionary(g => g.Key, g => g.First()); - Debug.Log($"[SoSync] soFolder={soFolderAssetPath}"); - Debug.Log($"[SoSync] selected: {string.Join(", ", selectedSheets)}"); + Debug.Log($"[AssetSynchronizer] assetFolder={assetFolderAssetPath}"); + Debug.Log($"[AssetSynchronizer] selected: {string.Join(", ", selectedSheets)}"); foreach (var pair in root) { string sheet = pair.Key; if (!selectedSheets.Contains(sheet)) { - Debug.Log($"[SoSync] SKIP(not selected): {sheet}"); + Debug.Log($"[AssetSynchronizer] SKIP(not selected): {sheet}"); continue; } - types.TryGetValue(sheet, out var dataType); - types.TryGetValue($"{sheet}So", out var soType); - if (dataType == null || soType == null) + types.TryGetValue($"{sheet}Entry", out var dataType); + types.TryGetValue($"{sheet}Asset", out var assetType); + if (dataType == null || assetType == null) { - Debug.LogWarning($"[SoSynchronizer] 타입 누락: {sheet} (data={dataType}, so={soType})"); + Debug.LogWarning($"[AssetSynchronizer] 타입 누락: {sheet} (entry={dataType}, asset={assetType})"); allSuccess = false; continue; } - string soAssetPath = $"{soFolderAssetPath}/{sheet}So.asset"; - var so = AssetDatabase.LoadAssetAtPath(soAssetPath); - if (so == null) + string assetPath = $"{assetFolderAssetPath}/{sheet}Asset.asset"; + var asset = AssetDatabase.LoadAssetAtPath(assetPath); + if (asset == null) { - Debug.Log($"[SoSync] CREATE SO: {soAssetPath}"); - so = ScriptableObject.CreateInstance(soType); - AssetDatabase.CreateAsset(so, soAssetPath); + Debug.Log($"[AssetSynchronizer] CREATE SO: {assetPath}"); + asset = ScriptableObject.CreateInstance(assetType); + AssetDatabase.CreateAsset(asset, assetPath); } else { - Debug.Log($"[SoSync] FOUND SO: {soAssetPath}"); + Debug.Log($"[AssetSynchronizer] FOUND SO: {assetPath}"); } var list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(dataType)); @@ -102,30 +102,30 @@ public bool SynchronizeAll(string fullJson, IReadOnlyCollection selected } else { - Debug.LogWarning($"[SoSynchronizer] 변환 실패: {sheet}.{field} -> {targetType?.Name} (원본:'{prop.Value}')"); + Debug.LogWarning($"[AssetSynchronizer] 변환 실패: {sheet}.{field} -> {targetType?.Name} (원본:'{prop.Value}')"); } } catch (Exception e) { - Debug.LogWarning($"[SoSynchronizer] 값 할당 예외: {sheet}.{field} -> {e.Message}"); + Debug.LogWarning($"[AssetSynchronizer] 값 할당 예외: {sheet}.{field} -> {e.Message}"); } } list.Add(inst); } - var setMethod = soType.GetMethod("SetDataList", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + var setMethod = assetType.GetMethod("SetDataList", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (setMethod == null) { - Debug.LogError($"{soType.Name}에 SetDataList 메서드가 없습니다."); + Debug.LogError($"{assetType.Name}에 SetDataList 메서드가 없습니다."); allSuccess = false; continue; } - Debug.Log($"[SoSync] INVOKE SetDataList for {sheet} (rows={(pair.Value as JArray)?.Count ?? 0})"); + Debug.Log($"[AssetSynchronizer] INVOKE SetDataList for {sheet} (rows={(pair.Value as JArray)?.Count ?? 0})"); - setMethod.Invoke(so, new object[] { list }); - EditorUtility.SetDirty(so); - _updatedPaths.Add(soAssetPath); + setMethod.Invoke(asset, new object[] { list }); + EditorUtility.SetDirty(asset); + _updatedPaths.Add(assetPath); } AssetDatabase.SaveAssets(); diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/SoSynchronizer.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/AssetSynchronizer.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/SoSynchronizer.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Implementations/Synchronization/AssetSynchronizer.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/IAssetSynchronizer.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/IAssetSynchronizer.cs new file mode 100644 index 000000000..dd2d70411 --- /dev/null +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/IAssetSynchronizer.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace DDD +{ + public interface IAssetSynchronizer + { + IReadOnlyList AssetUpdatedAssetPaths { get; } + bool SynchronizeAll(string fullJson, IReadOnlyCollection selectedSheets, string rootNamespace, string assetFolderAssetPath); + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/ISoSynchronizer.cs.meta b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/IAssetSynchronizer.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/ISoSynchronizer.cs.meta rename to Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/IAssetSynchronizer.cs.meta diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/ISoSynchronizer.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/ISoSynchronizer.cs deleted file mode 100644 index ba3e21323..000000000 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Interfaces/ISoSynchronizer.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; - -namespace DDD -{ - public interface ISoSynchronizer - { - IReadOnlyList UpdatedSoAssetPaths { get; } - bool SynchronizeAll(string fullJson, IReadOnlyCollection selectedSheets, string rootNamespace, string soFolderAssetPath); - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Manager/GoogleSheetManager.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Manager/GoogleSheetManager.cs index dc32b3e26..7cbdc8ee6 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Manager/GoogleSheetManager.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Manager/GoogleSheetManager.cs @@ -31,7 +31,7 @@ public class GoogleSheetManager : ScriptableObject private IJsonDiffer _differ; private ICodeGenerator _codeGenerator; private IValueConverterRegistry _converterRegistry; - private ISoSynchronizer _soSynchronizer; + private IAssetSynchronizer _assetSynchronizer; private IAddressablesRegistrar _addressablesRegistrar; private IVersionStore _versionStore; private IReloadCoordinator _reloadCoordinator; @@ -49,7 +49,7 @@ private void BuildServices() _differ = new NewtonsoftJsonDiffer(); _codeGenerator = new CSharpCodeGenerator(new DefaultTypeNameResolver()); _converterRegistry = new DefaultValueConverterRegistry(); - _soSynchronizer = new SoSynchronizer(_converterRegistry); + _assetSynchronizer = new AssetSynchronizer(_converterRegistry); _addressablesRegistrar = new AddressablesRegistrar(); _versionStore = new GoogleSheetChangeLogVersionStore(_settings.ChangeLogAssetPath); _reloadCoordinator = new SessionStateReloadCoordinator(); @@ -152,11 +152,11 @@ private async Task ContinueSoSync(string json, bool saveSnapshot) if (_settings.AutoCreateSheets != null) foreach (var s in _settings.AutoCreateSheets) selected.Add(s); if (_settings.SoSyncOnlySheets != null) foreach (var s in _settings.SoSyncOnlySheets) selected.Add(s); - bool ok = _soSynchronizer.SynchronizeAll(json, selected, _settings.RootNamespace, _settings.SoFolderAssetPath); + bool ok = _assetSynchronizer.SynchronizeAll(json, selected, _settings.RootNamespace, _settings.SoFolderAssetPath); if (_settings.AutoRegisterToAddressables) { - foreach (var soPath in _soSynchronizer.UpdatedSoAssetPaths) + foreach (var soPath in _assetSynchronizer.AssetUpdatedAssetPaths) _addressablesRegistrar.RegisterOrMoveEntry(soPath, _settings.AddressablesGroupName, _settings.AddressablesLabel); _addressablesRegistrar.SaveAll(); _addressablesRegistrar.BuildIfNeeded(_settings.AutoBuildAddressables); diff --git a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Settings/GoogleSheetSettingsSo.cs b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Settings/GoogleSheetSettingsSo.cs index 1a48c8dcc..9abb38765 100644 --- a/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Settings/GoogleSheetSettingsSo.cs +++ b/Assets/_DDD/_Scripts/GenerateGoogleSheet/Core/Settings/GoogleSheetSettingsSo.cs @@ -21,7 +21,7 @@ public class GoogleSheetSettingsSo : ScriptableObject [Header("출력 경로(모두 AssetPath, 한 곳만 바꾸면 연동)")] [SerializeField] private string _generateAssetBasePath = "Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated"; [SerializeField] private string _classesFolderName = "Classes"; - [SerializeField] private string _soFolderName = "So"; + [SerializeField] private string _assetFolderName = "Assets"; [SerializeField] private string _logsFolderName = "Logs"; [SerializeField] private string _backupsFolderName = "BackUps"; [SerializeField] private string _enumTypesFileName = "EnumTypes.cs"; @@ -30,7 +30,7 @@ public class GoogleSheetSettingsSo : ScriptableObject public string GenerateAssetBasePath => _generateAssetBasePath; public string ClassesFolderAssetPath => CombineAsset(_generateAssetBasePath, _classesFolderName); - public string SoFolderAssetPath => CombineAsset(_generateAssetBasePath, _soFolderName); + public string SoFolderAssetPath => CombineAsset(_generateAssetBasePath, _assetFolderName); public string LogsFolderAssetPath => CombineAsset(_generateAssetBasePath, _logsFolderName); public string BackupsFolderAssetPath => CombineAsset(_generateAssetBasePath, _backupsFolderName); public string EnumTypesAssetPath => CombineAsset(_generateAssetBasePath, _enumTypesFileName); @@ -74,7 +74,7 @@ private void OnValidate() { _generateAssetBasePath = NormalizeAssetPath(_generateAssetBasePath); _classesFolderName = (_classesFolderName ?? "Classes").Replace("/", "").Replace("\\", ""); - _soFolderName = (_soFolderName ?? "So").Replace("/", "").Replace("\\", ""); + _assetFolderName = (_assetFolderName ?? "So").Replace("/", "").Replace("\\", ""); _logsFolderName = (_logsFolderName ?? "Logs").Replace("/", "").Replace("\\", ""); _backupsFolderName = (_backupsFolderName ?? "BackUps").Replace("/", "").Replace("\\", ""); _enumTypesFileName = string.IsNullOrWhiteSpace(_enumTypesFileName) ? "EnumTypes.cs" : _enumTypesFileName; diff --git a/Assets/_DDD/_Scripts/Restaurant.meta b/Assets/_DDD/_Scripts/Restaurant.meta new file mode 100644 index 000000000..dcded6900 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8abdb2bb619b4d76941689e4589aa80f +timeCreated: 1756279736 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter.meta b/Assets/_DDD/_Scripts/Restaurant/Character.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter.meta rename to Assets/_DDD/_Scripts/Restaurant/Character.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/LookAtInteractionTarget.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs similarity index 53% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/LookAtInteractionTarget.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs index 8abdaabe7..68058dfd2 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/LookAtInteractionTarget.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs @@ -2,7 +2,7 @@ using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { /// /// 인터랙션 타겟을 바라보도록 시각(Spine/애니메이션) 컴포넌트에 위임하는 액션의 껍데기/골격. @@ -12,13 +12,7 @@ public class LookAtInteractionTarget : Action { [Header("Target Settings")] [Tooltip("InteractionPoints를 사용해 가장 적절한 지점을 바라봄")] - [SerializeField] private bool useInteractionPoints = true; - [Tooltip("타겟이 없을 때 즉시 실패할지 여부")] - [SerializeField] private bool failIfNoTarget = true; - - [Header("Update Settings")] - [Tooltip("프레임마다 갱신하여 지속적으로 바라볼지 (Running 반환) 여부. 비활성화 시 1회만 시도하고 성공 처리")] - [SerializeField] private bool continuousUpdate = true; + [SerializeField] private bool _useInteractionPoints = true; // Visual 전용 컴포넌트(나중 구현)를 위한 최소 인터페이스 // 실제 구현은 Spine/애니메이션 제어 컴포넌트에서 이 인터페이스를 구현하세요. @@ -32,84 +26,63 @@ public interface ILookAtVisual void EndLookAt(); } - private ILookAtVisual visual; - private GameObject cachedTarget; - private bool isLooking; - private Vector3 currentLookPosition; + private ILookAtVisual _visual; + private GameObject _cachedTarget; + private bool _isLooking; + private Vector3 _currentLookPosition; public override void OnStart() { - visual = gameObject.GetComponentInParent(); - cachedTarget = null; - isLooking = false; + _visual = gameObject.GetComponentInParent(); + _isLooking = false; + + var blackboard = gameObject.GetComponent(); + _cachedTarget = blackboard.GetBlackboardGameObject(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); } public override TaskStatus OnUpdate() - { - var target = GetTarget(); - if (target == null) + { + if (_cachedTarget == null) { - if (isLooking) + if (_isLooking) { // 타겟이 사라졌다면 정리 - visual?.EndLookAt(); - isLooking = false; + _visual?.EndLookAt(); + _isLooking = false; } - return failIfNoTarget ? TaskStatus.Failure : TaskStatus.Success; + return TaskStatus.Success; } - currentLookPosition = CalculateLookPosition(target); + _currentLookPosition = CalculateLookPosition(_cachedTarget); - if (!isLooking) + if (!_isLooking) { - visual?.TryBeginLookAt(currentLookPosition); - isLooking = true; + _visual?.TryBeginLookAt(_currentLookPosition); + _isLooking = true; } else { - visual?.UpdateLookAt(currentLookPosition); + _visual?.UpdateLookAt(_currentLookPosition); } - - // 연속 업데이트면 Running, 아니면 1회만 시도 후 Success 반환 - return continuousUpdate ? TaskStatus.Running : TaskStatus.Success; + + return TaskStatus.Success; } public override void OnEnd() { - if (isLooking) + if (_isLooking) { - visual?.EndLookAt(); - isLooking = false; + _visual?.EndLookAt(); + _isLooking = false; } - cachedTarget = null; - } - - private GameObject GetTarget() - { - // 캐시된 타겟이 유효하면 재사용 - if (IsValidTarget(cachedTarget)) - return cachedTarget; - - // 블랙보드에서 타겟 검색 - cachedTarget = gameObject.GetComponentInParent() - ?.GetCurrentInteractionTarget(); - - if (IsValidTarget(cachedTarget)) - return cachedTarget; - - // Interactor의 포커스된 타겟 검색 - var interactor = gameObject.GetComponentInParent(); - var focusedInteractable = interactor?.GetFocusedInteractable(); - cachedTarget = focusedInteractable?.GetInteractableGameObject(); - - return cachedTarget; + _cachedTarget = null; } private static bool IsValidTarget(GameObject target) => target != null && target; private Vector3 CalculateLookPosition(GameObject target) { - if (!useInteractionPoints) + if (!_useInteractionPoints) return target.transform.position; if (target.TryGetComponent(out var ric)) diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/LookAtInteractionTarget.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/LookAtInteractionTarget.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/LookAtInteractionTarget.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs new file mode 100644 index 000000000..602f24ab2 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs @@ -0,0 +1,222 @@ +using Opsive.BehaviorDesigner.Runtime.Tasks; +using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; +using Unity.VisualScripting; +using UnityEngine; + +namespace DDD.Restaurant +{ + /// + /// IAiMovement를 이용해 인터랙션 타겟으로 이동하는 액션 + /// + public class MoveToInteractionTarget : Action + { + [Header("Target Settings")] + [Tooltip("InteractionPoints를 사용해 가장 가까운 지점으로 이동")] + [SerializeField] private bool useInteractionPoints = true; + + [Header("Movement Settings")] + [Tooltip("목적지 도달 거리")] + [SerializeField] private float stoppingDistance = 0.01f; + [Tooltip("목적지 재계산 주기(초), 0 이하면 비활성화")] + [SerializeField] private float repathInterval = 0.5f; + + [Header("Debug Settings")] + [Tooltip("디버그 드로우 활성화")] + [SerializeField] private bool enableDebugDraw = true; + [Tooltip("디버그 선 색상")] + [SerializeField] private Color debugLineColor = Color.red; + [Tooltip("타겟 위치 기즈모 색상")] + [SerializeField] private Color targetGizmoColor = Color.yellow; + + private IAiMovement _movement; + private float _repathTimer; + private Vector3 _currentDestination; + private bool _isMoving; + private GameObject _target; + + public override void OnStart() + { + _movement = gameObject.GetComponent(); + _repathTimer = 0f; + _isMoving = false; + + var blackboard = gameObject.GetComponent(); + _target = blackboard.GetBlackboardGameObject(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); + } + + public override TaskStatus OnUpdate() + { + if (_movement == null) + return TaskStatus.Failure; + if (_target == null) + { + return TaskStatus.Failure; + } + + if (ShouldUpdateDestination()) + { + _currentDestination = CalculateDestination(_target); + StartOrUpdateMovement(); + } + + return CheckMovementCompletion(); + } + + public override void OnEnd() + { + StopMovement(); + } + + protected override void OnDrawGizmos() + { + if (!enableDebugDraw || _target == null) return; + + // 타겟 이름을 자신의 게임오브젝트 위에 표시 +#if UNITY_EDITOR + UnityEditor.Handles.Label(transform.position + Vector3.up * 2f, + $"Target: {_target.name}"); +#endif + + // 타겟 위치에 기즈모 그리기 + Gizmos.color = targetGizmoColor; + if (_isMoving && _currentDestination != Vector3.zero) + { + Gizmos.DrawWireSphere(_currentDestination, 0.5f); + } + else if (_target != null) + { + Gizmos.DrawWireSphere(_target.transform.position, 0.5f); + } + + // 현재 위치에서 타겟까지 직선 그리기 + Gizmos.color = debugLineColor; + Vector3 targetPos = _isMoving && _currentDestination != Vector3.zero + ? _currentDestination + : (_target != null ? _target.transform.position : Vector3.zero); + + if (targetPos != Vector3.zero) + { + Gizmos.DrawLine(transform.position, targetPos); + } + + // 현재 오브젝트 위치에 작은 기즈모 그리기 + Gizmos.color = Color.blue; + Gizmos.DrawWireCube(transform.position, Vector3.one * 0.3f); + } + + protected override void OnDrawGizmosSelected() + { + if (!enableDebugDraw || _target == null) return; + + // 선택되었을 때 추가 정보 표시 +#if UNITY_EDITOR + Vector3 targetPos = _isMoving && _currentDestination != Vector3.zero + ? _currentDestination + : _target.transform.position; + + float distance = Vector3.Distance(transform.position, targetPos); + UnityEditor.Handles.Label(targetPos + Vector3.up * 1f, + $"Distance: {distance:F2}m\nStopping: {stoppingDistance:F2}m"); + + // InteractionPoints가 있다면 모두 표시 + if (useInteractionPoints && _target.TryGetComponent(out var ric)) + { + var points = ric.GetInteractionPoints(); + if (points != null && points.Length > 0) + { + Gizmos.color = Color.cyan; + foreach (var point in points) + { + Gizmos.DrawWireSphere(point, 0.2f); + } + } + } +#endif + } + + private bool ShouldUpdateDestination() + { + _repathTimer -= Time.deltaTime; + return !_isMoving || (repathInterval > 0f && _repathTimer <= 0f); + } + + private Vector3 CalculateDestination(GameObject target) + { + _repathTimer = repathInterval; + + if (!useInteractionPoints) + return target.transform.position; + + return target.TryGetComponent(out var ric) + ? GetNearestInteractionPoint(ric) + : target.transform.position; + } + + private Vector3 GetNearestInteractionPoint(RestaurantInteractionComponent ric) + { + var points = ric.GetInteractionPoints(); + if (points == null || points.Length == 0) + return ric.transform.position; + + var agentPosition = GetAgentPosition(); + var nearestPoint = ric.transform.position; + var minDistanceSqr = float.MaxValue; + + foreach (var point in points) + { + var distanceSqr = (point - agentPosition).sqrMagnitude; + if (distanceSqr < minDistanceSqr) + { + minDistanceSqr = distanceSqr; + nearestPoint = point; + } + } + + return nearestPoint; + } + + private void StartOrUpdateMovement() + { + if (!_isMoving) + { + if (_movement.TryMoveToPosition(_currentDestination)) + { + _movement.EnableMove(); + _movement.PlayMove(); + _isMoving = true; + } + } + else + { + _movement.TryMoveToPosition(_currentDestination); + } + } + + private TaskStatus CheckMovementCompletion() + { + var distanceSqr = (GetAgentPosition() - _currentDestination).sqrMagnitude; + var stoppingDistanceSqr = stoppingDistance * stoppingDistance; + + if (distanceSqr <= stoppingDistanceSqr || _movement.HasReachedDestination()) + { + StopMovement(); + return TaskStatus.Success; + } + + return TaskStatus.Running; + } + + private void StopMovement() + { + if (_movement != null && _isMoving) + { + _movement.StopMove(); + _movement.DisableMove(); + _isMoving = false; + } + } + + private Vector3 GetAgentPosition() => + _movement?.CurrentPosition ?? transform.position; + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/MoveToInteractionTarget.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/MoveToInteractionTarget.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Actions/MoveToInteractionTarget.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Decorator.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Decorator.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Decorator/TimeLimiter.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs similarity index 99% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Decorator/TimeLimiter.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs index ec725c587..15c13cd29 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Decorator/TimeLimiter.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs @@ -188,7 +188,7 @@ public void Execute(ref DynamicBuffer branchComponents, branchComponents[taskComponent.BranchIndex] = branchComponent; continue; } - else if (taskComponent.Status != TaskStatus.Running) + if (taskComponent.Status != TaskStatus.Running) { continue; } diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Decorator/TimeLimiter.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Decorator/TimeLimiter.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Common/Decorator/TimeLimiter.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/ContinueRestaurantOrder.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/ContinueRestaurantOrder.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/ContinueRestaurantOrder.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/ContinueRestaurantOrder.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/ContinueRestaurantOrder.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/ContinueRestaurantOrder.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/ContinueRestaurantOrder.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/ContinueRestaurantOrder.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/StartRestaurantOrder.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs similarity index 59% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/StartRestaurantOrder.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs index bf6f0544b..b954d1bf7 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/StartRestaurantOrder.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs @@ -2,7 +2,7 @@ using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class StartRestaurantOrder : Action { @@ -12,6 +12,8 @@ public class StartRestaurantOrder : Action [SerializeField] private bool _requireCanInteract = true; [Tooltip("성공 시 블랙보드에 현재 인터랙션 대상을 등록합니다")] [SerializeField] private bool _registerOnBlackboard = true; + [Tooltip("성공 시 블랙보드에 현재 인터랙션 대상을 등록합니다")] + [SerializeField] private bool _UnregisterOnBlackboard = false; private IInteractor _interactor; private bool _isGetInteractor; @@ -19,13 +21,13 @@ public class StartRestaurantOrder : Action public override void OnStart() { _isGetInteractor = gameObject.TryGetComponent(out _interactor); + if (!_isGetInteractor) Debug.LogError($"[{GetType().Name}] IInteractor를 찾을 수 없습니다: {gameObject.name}"); } public override TaskStatus OnUpdate() { - // TODO : 아래 타겟 찾기가 RestaurantOrderAvailable과 동일해야 함, 동일하면 중복될 필요 없으니 스태틱 유틸 함수정도로 만들어서 공유하기. // 레스토랑 주문 인터랙션 후보를 가져옴 TaskStatus targetSearchSuccess = RestaurantOrderAvailable.FindAvailableOrderInteractable(_requireCanInteract, _targetOrderType, out var outInteractable); @@ -34,34 +36,24 @@ public override TaskStatus OnUpdate() return TaskStatus.Failure; } - // TODO : 아래 상호작용 수행 로직이 우리 프로젝트의 권장하는 방식이 아님. 플레이어가 오브젝트에 인터랙션하는 것과 비슷한 흐름으로 NPC가 오브젝트에 인터랙션하게 만들 것. // 상호작용 수행: 액션이 붙은 에이전트를 Interactor로 사용 if (!_isGetInteractor || !_interactor.CanInteractTo(outInteractable)) { return TaskStatus.Failure; } - // TODO : 이벤트 통해서 인터랙션. 직접 호출하지 말 것! - var interacted = outInteractable.OnInteracted(_interactor); - if (!interacted) - { - return TaskStatus.Failure; - } + RestaurantEvents.InteractionEvent.RequestInteraction(_interactor.GetInteractorGameObject(), outInteractable.gameObject, outInteractable.GetInteractionType()); if (_registerOnBlackboard) { - // 공용 블랙보드 우선 - var shared = gameObject.GetComponentInChildren(); - if (shared != null) - { - shared.SetCurrentInteractionTarget(outInteractable.gameObject); - } - else - { - // 하위 호환: 고객 전용 블랙보드 지원 - var customerBb = gameObject.GetComponentInParent(); - customerBb?.SetCurrentInteractionTarget(outInteractable.gameObject); - } + var customerBlackboard = gameObject.GetComponent(); + customerBlackboard?.SetBlackboardGameObject(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget), outInteractable.gameObject); + } + + if (_UnregisterOnBlackboard) + { + var customerBlackboard = gameObject.GetComponent(); + customerBlackboard?.SetBlackboardGameObject(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget), null); } return TaskStatus.Success; diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/StartRestaurantOrder.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/StartRestaurantOrder.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/StartRestaurantOrder.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs new file mode 100644 index 000000000..30feb0826 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs @@ -0,0 +1,66 @@ +using Opsive.BehaviorDesigner.Runtime.Tasks; +using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; +using UnityEngine; + +namespace DDD.Restaurant +{ + //범용적으로 사용할 수 있을 것 같음 + //차후 제네릭으로 변경 가능성 있음 + public class WaitForPlayerInteraction : Action + { + [SerializeField] private RestaurantOrderType _targetOrderType; + private IInteractionSubsystemObject _interactionSubsystem; + private bool _isGetInteractionSubsystem; + + public override void OnStart() + { + GameObject interactionTarget = null; + if (!gameObject.TryGetComponent(out var sharedBlackboard)) return; + interactionTarget = + sharedBlackboard.GetBlackboardGameObject( + nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget)); + + if (interactionTarget == null) + { + Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); + return; + } + + if (!interactionTarget.TryGetComponent(out var interactionComponent)) + Debug.LogError( + $"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}"); + + if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner) + { + Debug.LogError( + $"[{GetType().Name}]에서 {nameof(IInteractionSubsystemOwner)}를 찾을 수 없습니다: {gameObject.name}"); + return; + } + + if (!subsystemOwner.TryGetSubsystemObject(out _interactionSubsystem)) + { + Debug.LogError( + $"[{GetType().Name}]에서 {nameof(IInteractionSubsystemObject)}를 찾을 수 없습니다: {gameObject.name}"); + return; + } + + _isGetInteractionSubsystem = true; + } + + public override TaskStatus OnUpdate() + { + if (!_isGetInteractionSubsystem) return TaskStatus.Failure; + + TaskStatus result = CheckToSubsystemStatus(); + if (result == TaskStatus.Success) Debug.Log($"[{GetType().Name}] Success"); + return result; + } + + private TaskStatus CheckToSubsystemStatus() + { + return _interactionSubsystem.GetInteractionSubsystemType() == _targetOrderType + ? TaskStatus.Running + : TaskStatus.Success; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/WaitForPlayerInteraction.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/WaitForPlayerInteraction.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Actions/WaitForPlayerInteraction.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Conditionals.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Conditionals.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Conditionals.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Conditionals.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Conditionals/RestaurantOrderAvailable.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Conditionals/RestaurantOrderAvailable.cs similarity index 96% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Conditionals/RestaurantOrderAvailable.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Conditionals/RestaurantOrderAvailable.cs index b10254f84..da16bc590 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Conditionals/RestaurantOrderAvailable.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Conditionals/RestaurantOrderAvailable.cs @@ -5,7 +5,7 @@ using UnityEngine; using DDD; -namespace DDD +namespace DDD.Restaurant { public class RestaurantOrderAvailable : Conditional { @@ -53,8 +53,7 @@ public static TaskStatus FindAvailableOrderInteractable(bool checkCanInteract if (outInteractable == null) continue; if (!outInteractable.TryGetSubsystemObject(out var subsystem)) continue; - if (EqualityComparer.Default.Equals(subsystem.GetInteractionSubsystemType(), targetOrderType) - ) + if (EqualityComparer.Default.Equals(subsystem.GetInteractionSubsystemType(), targetOrderType)) { // CheckCanInteract이 false면 타입만 맞으면 성공 if (!checkCanInteract) diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Conditionals/RestaurantOrderAvailable.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Conditionals/RestaurantOrderAvailable.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Conditionals/RestaurantOrderAvailable.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/Conditionals/RestaurantOrderAvailable.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerAiComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs similarity index 58% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerAiComponent.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs index 6206ce2fb..64c65fa36 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerAiComponent.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs @@ -5,26 +5,26 @@ using UnityEngine; using UnityEngine.AddressableAssets; -namespace DDD +namespace DDD.Restaurant { [RequireComponent(typeof(BehaviorTree))] - [RequireComponent(typeof(RestaurantCustomerBlackboardComponent))] - public class RestaurantCustomerAiComponent : MonoBehaviour, IRestaurantCustomerAi + [RequireComponent(typeof(CustomerBlackboardComponent))] + public class CustomerAiComponent : MonoBehaviour, ICustomerAi { protected BehaviorTree _behaviorTree; - protected RestaurantCustomerBlackboardComponent _blackboardComponent; + protected CustomerBlackboardComponent _blackboardComponent; private void Awake() { _behaviorTree = GetComponent(); - _blackboardComponent = GetComponent(); + _blackboardComponent = GetComponent(); } - public void InitializeAi(CustomerData inCustomerData) + public async Task InitializeAi(CustomerDataEntry inCustomerDataEntry) { try { - InitializeAiInternal(inCustomerData); + await InitializeAiInternal(inCustomerDataEntry); } catch (Exception e) { @@ -34,21 +34,21 @@ public void InitializeAi(CustomerData inCustomerData) } } - private async Task InitializeAiInternal(CustomerData inCustomerData) + private async Task InitializeAiInternal(CustomerDataEntry inCustomerDataEntry) { var customerState = RestaurantState.Instance.CustomerState; - var subtree = customerState.GetLoadedSubtree(inCustomerData.CustomerType); + var subtree = customerState.GetLoadedSubtree(inCustomerDataEntry.CustomerType); if (subtree == null) { Debug.LogError( - $"[CustomerCharacter] No preloaded subtree found for CustomerType: {inCustomerData.CustomerType}. Make sure CustomerBehaviorData is loaded."); - subtree = await customerState.GetOrLoadSubtree(inCustomerData.CustomerType); + $"[CustomerCharacter] No preloaded subtree found for CustomerType: {inCustomerDataEntry.CustomerType}. Make sure CustomerBehaviorData is loaded."); + subtree = await customerState.GetOrLoadSubtree(inCustomerDataEntry.CustomerType); } _behaviorTree.Subgraph = subtree; - _blackboardComponent.InitializeWithBehaviorTree(subtree); - _blackboardComponent.SetCustomerData(inCustomerData); + _blackboardComponent.InitializeWithBehaviorTree(_behaviorTree); + _blackboardComponent.SetCustomerData(inCustomerDataEntry.Id); // TODO : 1. Subtree - Action, Condition // TODO : 2. Blackboard _behaviorTree.StartBehavior(); diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerAiComponent.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerAiComponent.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerAiComponent.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs new file mode 100644 index 000000000..41aee0f18 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs @@ -0,0 +1,38 @@ +using Opsive.BehaviorDesigner.Runtime; +using UnityEngine; + +namespace DDD +{ + public class CustomerBlackboardComponent : MonoBehaviour, ICustomerBlackboard, IAISharedBlackboard + { + // private Subtree _behaviorTree; + private BehaviorTree _behaviorTree; + + public void InitializeWithBehaviorTree(BehaviorTree inBehaviorTree) + { + _behaviorTree = inBehaviorTree; + if (_behaviorTree) + { + _behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject); + } + } + + public void SetCustomerData(string inCustomerDataId) + { + if (!_behaviorTree) return; + _behaviorTree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerDataId), inCustomerDataId); + } + + public void SetBlackboardGameObject(string key, GameObject inGameObject) + { + if (_behaviorTree == null) return; + _behaviorTree.SetVariableValue(key, inGameObject); + } + + public GameObject GetBlackboardGameObject(string key) + { + if (_behaviorTree == null) return null; + return _behaviorTree.GetVariable(key)?.Value; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerBlackboardComponent.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerBlackboardComponent.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/AI/Customer/CustomerBlackboardComponent.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Core.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Core.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterAnimation.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterAnimation.cs similarity index 89% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterAnimation.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterAnimation.cs index 88058c404..03a4d5a4c 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterAnimation.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterAnimation.cs @@ -3,7 +3,7 @@ namespace DDD { [RequireComponent(typeof(SpineController))] - public class RestaurantCharacterAnimation : MonoBehaviour + public class CharacterAnimation : MonoBehaviour { protected SpineController _spineController; diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterAnimation.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterAnimation.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterAnimation.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterAnimation.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterInteraction.cs similarity index 51% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterInteraction.cs index 3db7a4412..5ec7c67ac 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterInteraction.cs @@ -1,10 +1,11 @@ +using System; using System.Collections.Generic; using Sirenix.OdinInspector; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - public class RestaurantCharacterInteraction : MonoBehaviour, IInteractor, IEventHandler + public class CharacterInteraction : MonoBehaviour, IInteractor, IEventHandler { [EnumToggleButtons, SerializeField] protected InteractionType _availableInteractions; [SerializeField, ReadOnly] protected Collider[] _nearColliders = new Collider[10]; @@ -14,96 +15,36 @@ public class RestaurantCharacterInteraction : MonoBehaviour, IInteractor, IEvent protected IInteractable _nearestInteractable; protected IInteractable _previousInteractable; protected IInteractable _interactingTarget; - - protected float _interactHeldTime; - protected bool _isInteracting; protected float _interactionRadius = 1f; protected LayerMask _interactionLayerMask = (LayerMask)(-1); private Dictionary _cachedSolvers = new(); - protected virtual void Start() { } - - protected virtual void Update() + protected virtual void Start() { - _nearestInteractable = GetNearestInteractable(); - - if (_nearestInteractable != _previousInteractable) - { - _previousInteractable = _nearestInteractable; - OnNearestInteractableChanged(_nearestInteractable); - } - - if (_isInteracting) - { - if (_nearestInteractable != _interactingTarget || CanInteractTo(_interactingTarget) == false) - { - ResetInteractionState(); - return; - } - - _interactHeldTime += Time.deltaTime; - - float requiredHoldTime = _interactingTarget.GetExecutionParameters().HoldTime; - float ratio = Mathf.Clamp01(_interactHeldTime / requiredHoldTime); - - if (_interactHeldTime >= requiredHoldTime) - { - OnInteractionHoldProgress(1f); - _isInteracting = false; - _interactingTarget.OnInteracted(this); - _interactingTarget = null; - OnInteractionCompleted(); - } - - OnInteractionHoldProgress(ratio); - } } - - protected virtual void OnDestroy() { } - - protected virtual void OnNearestInteractableChanged(IInteractable newTarget) { } - protected virtual void OnInteractionHoldProgress(float ratio) { } + + protected virtual void OnDestroy() + { + } + protected virtual void OnInteractionCompleted() { } - - protected void ResetInteractionState() + + public virtual void HandleEvent(RestaurantInteractionEvent evt) { - _isInteracting = false; - _interactingTarget = null; - _interactHeldTime = 0f; - OnInteractionHoldProgress(0f); + Debug.Log($"Event handled : {evt.ToString()}"); } - protected IInteractable GetNearestInteractable() - { - int colliderCount = Physics.OverlapSphereNonAlloc(transform.position, _interactionRadius, _nearColliders, _interactionLayerMask, QueryTriggerInteraction.Collide); - float closestDistance = float.MaxValue; - IInteractable closest = null; - - for (int i = 0; i < colliderCount; i++) - { - var col = _nearColliders[i]; - if (col.TryGetComponent(out var interactable) == false) continue; - - var type = interactable.GetInteractionType(); - if (interactable.IsInteractionHidden()) continue; - if (CanSolveInteractionType(type) == false) continue; - - float distance = Vector3.Distance(transform.position, col.transform.position); - if (distance < closestDistance) - { - closestDistance = distance; - closest = interactable; - } - } - - return closest; - } - - public virtual void Invoke(RestaurantInteractionEvent evt) { } - public GameObject GetInteractorGameObject() => gameObject; + protected void TryInteraction(IInteractable interactable, ScriptableObject payload = null) + { + var causer = gameObject; + var target = interactable.GetInteractableGameObject(); + var interactionType = _nearestInteractable.GetInteractionType(); + RestaurantEvents.InteractionEvent.RequestInteraction(causer, target, interactionType, payload); + } + public IInteractionSolver GetInteractionSolver(InteractionType interactionType) { TryGetSolverForType(interactionType, out var solver); @@ -159,5 +100,27 @@ public bool CanInteractTo(IInteractable interactable, ScriptableObject payloadSo if (TryGetSolverFor(interactable, out var solver) == false) return false; return solver.CanExecuteInteraction(this, interactable, payloadSo); } + + public virtual void InitializeSolvers() + { + var typesToSolver = RestaurantInteractionEventSolvers.TypeToSolver; + InitializeInteractionSolvers(typesToSolver); + } + + protected void InitializeInteractionSolvers(Dictionary typesToSolver) + { + foreach (var typeToSolver in typesToSolver) + { + var flag = typeToSolver.Key; + if (flag == InteractionType.None) continue; + + if ((AvailableInteractions & flag) == 0) continue; + + if (!TryGetComponent(typeToSolver.Value, out _)) + { + gameObject.AddComponent(typeToSolver.Value); + } + } + } } } diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterInteraction.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterInteraction.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterInteraction.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovement.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovement.cs similarity index 55% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovement.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovement.cs index 19920b0b2..a7f326db4 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovement.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovement.cs @@ -2,18 +2,18 @@ namespace DDD { - public class RestaurantCharacterMovement : MonoBehaviour + public class CharacterMovement : MonoBehaviour { - private RestaurantCharacterMovementConstraint _constraint; + private CharacterMovementConstraint _constraint; protected virtual void Awake() { - _constraint = gameObject.AddComponent(); + _constraint = gameObject.AddComponent(); } public virtual bool CanMove() { - // Get all components implements IRestaurantMovementConstraint - var constraints = GetComponents(); + // Get all components implements IMovementConstraint + var constraints = GetComponents(); // TODO : Maybe need optimize GetComponents? foreach (var movementConstraint in constraints) { diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovement.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovement.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovement.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovement.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovementConstraint.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovementConstraint.cs new file mode 100644 index 000000000..076264ed4 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovementConstraint.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace DDD +{ + [RequireComponent(typeof(CharacterAnimation))] + public class CharacterMovementConstraint : MonoBehaviour, IMovementConstraint + { + public bool IsBlockingMovement() + { + if (GetComponent().IsPlayingAnimation()) + { + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovementConstraint.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovementConstraint.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovementConstraint.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterMovementConstraint.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterVisual.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterVisual.cs similarity index 93% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterVisual.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterVisual.cs index 13b6bfa02..5b866df48 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterVisual.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterVisual.cs @@ -2,7 +2,7 @@ namespace DDD { - public class RestaurantCharacterVisual : MonoBehaviour + public class CharacterVisual : MonoBehaviour { private ICurrentDirection _iCurrentDirection; diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterVisual.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterVisual.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterVisual.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/CharacterVisual.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Core/RestaurantCharacter.cs similarity index 61% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/RestaurantCharacter.cs index 892a2bbfe..f3a32003e 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Core/RestaurantCharacter.cs @@ -1,31 +1,20 @@ using Sirenix.OdinInspector; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - [RequireComponent(typeof(RestaurantCharacterInteraction))] + [RequireComponent(typeof(CharacterInteraction))] [RequireComponent(typeof(SpineController))] public class RestaurantCharacter : MonoBehaviour, IGameCharacter, IInteractor { - RestaurantCharacterInteraction _interactionComponent; + CharacterInteraction _interactionComponent; protected SpineController _spineController; protected virtual void Awake() { - _interactionComponent = GetComponent(); + _interactionComponent = GetComponent(); + _interactionComponent.InitializeSolvers(); _spineController = GetComponent(); - foreach (var typeToSolver in RestaurantInteractionEventSolvers.TypeToSolver) - { - var flag = typeToSolver.Key; - if (flag == InteractionType.None) continue; - - if ((_interactionComponent.AvailableInteractions & flag) == 0) continue; - - if (!TryGetComponent(typeToSolver.Value, out _)) - { - gameObject.AddComponent(typeToSolver.Value); - } - } } protected virtual void Start() diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Core/RestaurantCharacter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacter.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Core/RestaurantCharacter.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IAiMovement.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IAiMovement.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IAiMovement.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IAiMovement.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IAiMovement.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IAiMovement.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IAiMovement.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IAiMovement.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/ICurrentDirection.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICurrentDirection.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/ICurrentDirection.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICurrentDirection.cs diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/ICurrentDirection.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICurrentDirection.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/ICurrentDirection.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICurrentDirection.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerAi.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerAi.cs new file mode 100644 index 000000000..8672b0e08 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerAi.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace DDD +{ + public interface ICustomerAi + { + Task InitializeAi(CustomerDataEntry inCustomerDataEntry); + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerAi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerAi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerAi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerAi.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs new file mode 100644 index 000000000..8754ec832 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace DDD +{ + public enum RestaurantCustomerBlackboardKey + { + SelfGameObject, + CustomerDataId, + CurrentInteractionTarget, + } + + public interface ICustomerBlackboard + { + void SetCustomerData(string inCustomerDataId); + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerBlackboard.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerBlackboard.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/ICustomerBlackboard.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantMovementConstraint.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IMovementConstraint.cs similarity index 58% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantMovementConstraint.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IMovementConstraint.cs index 462d87b94..5bb57d976 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantMovementConstraint.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IMovementConstraint.cs @@ -1,6 +1,6 @@ namespace DDD { - public interface IRestaurantMovementConstraint + public interface IMovementConstraint { public bool IsBlockingMovement(); } diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantMovementConstraint.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IMovementConstraint.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantMovementConstraint.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Interfaces/IMovementConstraint.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Npc.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Npc.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Npc.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/Customer.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Npc/Customer.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/Npc/Customer/CustomerCharacter.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/Customer/CustomerCharacter.cs new file mode 100644 index 000000000..24c04c2e0 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/Customer/CustomerCharacter.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using Opsive.BehaviorDesigner.Runtime; +using UnityEngine; +using UnityEngine.AddressableAssets; + +namespace DDD.Restaurant +{ + [RequireComponent(typeof(CustomerAiComponent))] + public class CustomerCharacter : NpcCharacter, ICustomerInitializer + { + private CustomerDataEntry _customerDataEntry; + protected ICustomerAi _customerAi; + + protected override void Awake() + { + base.Awake(); + _customerAi = GetComponent(); + } + + public void Initialize(CustomerDataEntry customerDataEntry) + { + _customerDataEntry = customerDataEntry; + _customerAi.InitializeAi(_customerDataEntry); + + // 스킨 설정 + _spineController.SetSkin(_customerDataEntry.SpineSkinKey); + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/Customer/CustomerCharacter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Npc/Customer/CustomerCharacter.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcCharacter.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcCharacter.cs similarity index 55% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcCharacter.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcCharacter.cs index 0b55d5293..10e29bd62 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcCharacter.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcCharacter.cs @@ -1,10 +1,10 @@ using Opsive.BehaviorDesigner.Runtime; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - [RequireComponent(typeof(RestaurantNpcMovement))] - public class RestaurantNpcCharacter : RestaurantCharacter + [RequireComponent(typeof(NpcMovement))] + public class NpcCharacter : RestaurantCharacter { protected override void Awake() { diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcCharacter.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcCharacter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcCharacter.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcCharacter.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcMovement.cs similarity index 98% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcMovement.cs index e73acf69f..4248d0aa1 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcMovement.cs @@ -4,7 +4,7 @@ namespace DDD { [RequireComponent(typeof(AIPath))] - public class RestaurantNpcMovement : RestaurantCharacterMovement, IAiMovement, ICurrentDirection + public class NpcMovement : CharacterMovement, IAiMovement, ICurrentDirection { private IAstarAI _iAstarAi; private Vector3 _lastDirection = Vector3.forward; diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcMovement.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Npc/RestaurantNpcMovement.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Npc/NpcMovement.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Player.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Player.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerAnimation.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerAnimation.cs similarity index 56% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerAnimation.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerAnimation.cs index 603944132..8ae579f6d 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerAnimation.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerAnimation.cs @@ -1,35 +1,35 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - [RequireComponent(typeof(RestaurantPlayerMovement))] - public class RestaurantPlayerAnimation : RestaurantCharacterAnimation + [RequireComponent(typeof(PlayerMovement))] + public class PlayerAnimation : CharacterAnimation { - private RestaurantPlayerMovement _restaurantPlayerMovement; + private PlayerMovement _playerMovement; protected override void Awake() { base.Awake(); - _restaurantPlayerMovement = GetComponent(); + _playerMovement = GetComponent(); } protected override void Start() { base.Start(); - _restaurantPlayerMovement.OnMoving += OnMove; - _restaurantPlayerMovement.OnDashing += OnDash; + _playerMovement.OnMoving += OnMove; + _playerMovement.OnDashing += OnDash; } protected override void OnDestroy() { base.OnDestroy(); - if (_restaurantPlayerMovement) + if (_playerMovement) { - _restaurantPlayerMovement.OnMoving -= OnMove; - _restaurantPlayerMovement.OnDashing -= OnDash; + _playerMovement.OnMoving -= OnMove; + _playerMovement.OnDashing -= OnDash; } } diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerAnimation.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerAnimation.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerAnimation.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerAnimation.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerCharacter.cs similarity index 69% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerCharacter.cs index 7dad4869f..1abe46f50 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerCharacter.cs @@ -1,11 +1,11 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - [RequireComponent(typeof(RestaurantPlayerMovement))] - public class RestaurantPlayerCharacter : RestaurantCharacter + [RequireComponent(typeof(PlayerMovement))] + public class PlayerCharacter : RestaurantCharacter { - protected override async void Awake() + protected override void Awake() { base.Awake(); diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerCharacter.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerCharacter.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerCharacter.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInput.cs similarity index 93% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInput.cs index dc22b7dcb..3d158502a 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInput.cs @@ -1,9 +1,9 @@ using UnityEngine; using UnityEngine.InputSystem; -namespace DDD +namespace DDD.Restaurant { - public class RestaurantPlayerInput : MonoBehaviour + public class PlayerInput : MonoBehaviour { private RestaurantPlayerData _playerDataSo; diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInput.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInput.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInput.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInteraction.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInteraction.cs new file mode 100644 index 000000000..21832e1ea --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInteraction.cs @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.InputSystem; + +namespace DDD.Restaurant +{ + public class PlayerInteraction : CharacterInteraction + { + private RestaurantPlayerData _restaurantPlayerDataSo; + + private float _interactHeldTime; + private bool _isInteracting; + + protected override void Start() + { + base.Start(); + + _ = Initialize(); + } + + private Task Initialize() + { + _restaurantPlayerDataSo = RestaurantData.Instance.PlayerData; + Debug.Assert(_restaurantPlayerDataSo != null, "_restaurantPlayerDataSo is null"); + + _restaurantPlayerDataSo!.InteractAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Interact)); + _restaurantPlayerDataSo.InteractAction.performed += OnInteractPerformed; + _restaurantPlayerDataSo.InteractAction.canceled += OnInteractCanceled; + + _interactionRadius = _restaurantPlayerDataSo.InteractionRadius; + _interactionLayerMask = _restaurantPlayerDataSo.InteractionLayerMask; + + EventBus.Register(this); + + return Task.CompletedTask; + } + + public override void InitializeSolvers() + { + var typesToSolver = RestaurantInteractionEventSolvers.TypeToSolver; + var playerSolver = RestaurantInteractionEventSolvers.TypeToPlayerSolver; + foreach(var pair in playerSolver) + { + typesToSolver.Remove(pair.Key); + } + InitializeInteractionSolvers(typesToSolver); + InitializeInteractionSolvers(playerSolver); + } + + protected override void OnDestroy() + { + base.OnDestroy(); + + if (_restaurantPlayerDataSo != null) + { + _restaurantPlayerDataSo.InteractAction.performed -= OnInteractPerformed; + _restaurantPlayerDataSo.InteractAction.canceled -= OnInteractCanceled; + } + + EventBus.Unregister(this); + } + + protected virtual void Update() + { + _nearestInteractable = GetNearestInteractable(); + + if (_nearestInteractable != _previousInteractable) + { + _previousInteractable = _nearestInteractable; + OnNearestInteractableChanged(_nearestInteractable); + } + + if (_isInteracting) + { + if (_nearestInteractable != _interactingTarget || CanInteractTo(_interactingTarget) == false) + { + ResetInteractionState(); + return; + } + + _interactHeldTime += Time.deltaTime; + + float requiredHoldTime = _interactingTarget.GetExecutionParameters().HoldTime; + float ratio = Mathf.Clamp01(_interactHeldTime / requiredHoldTime); + + if (_interactHeldTime >= requiredHoldTime) + { + TryInteraction(_nearestInteractable); + OnInteractionCompleted(); + + ResetInteractionState(); + OnInteractionHoldProgress(0f); + } + else + { + OnInteractionHoldProgress(ratio); + } + } + } + + + private void OnInteractPerformed(InputAction.CallbackContext context) + { + if (_nearestInteractable == null || CanInteractTo(_nearestInteractable) == false) return; + + float requiredHoldTime = _nearestInteractable.GetExecutionParameters().HoldTime; + + if (requiredHoldTime <= 0f) + { + TryInteraction(_nearestInteractable); + } + else + { + _isInteracting = true; + _interactHeldTime = 0f; + _interactingTarget = _nearestInteractable; + } + } + + private void OnInteractCanceled(InputAction.CallbackContext context) + { + OnInteractionHoldProgress(0f); + ResetInteractionState(); + } + + protected void OnNearestInteractableChanged(IInteractable newTarget) + { + if (newTarget != null) + { + BroadcastShowUi(newTarget, CanInteractTo(newTarget), 0f); + } + else + { + EventBus.Broadcast(GameEvents.HideInteractionUiEvent); + } + } + + protected void OnInteractionHoldProgress(float ratio) + { + if (_interactingTarget != null) + { + BroadcastShowUi(_interactingTarget, CanInteractTo(_interactingTarget), ratio); + } + } + + protected override void OnInteractionCompleted() + { + + } + + private void BroadcastShowUi(IInteractable interactable, bool canInteract, float ratio) + { + var evt = GameEvents.ShowInteractionUiEvent; + evt.CanInteract = canInteract; + evt.TextKey = interactable.GetDisplayParameters().MessageKey; + evt.HoldProgress = ratio; + EventBus.Broadcast(evt); + } + + protected void ResetInteractionState() + { + _interactingTarget = null; + + // Hold Progress + _isInteracting = false; + _interactingTarget = null; + _interactHeldTime = 0f; + OnInteractionHoldProgress(0f); + } + + protected IInteractable GetNearestInteractable() + { + int colliderCount = Physics.OverlapSphereNonAlloc(transform.position, _interactionRadius, _nearColliders, _interactionLayerMask, QueryTriggerInteraction.Collide); + float closestDistance = float.MaxValue; + IInteractable closest = null; + + for (int i = 0; i < colliderCount; i++) + { + var col = _nearColliders[i]; + if (col.TryGetComponent(out var interactable) == false) continue; + + var type = interactable.GetInteractionType(); + if (interactable.IsInteractionHidden()) continue; + if (CanSolveInteractionType(type) == false) continue; + + float distance = Vector3.Distance(transform.position, col.transform.position); + if (distance < closestDistance) + { + closestDistance = distance; + closest = interactable; + } + } + + return closest; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInteraction.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerInteraction.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerMovement.cs similarity index 99% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerMovement.cs index 8a313c1d8..98a911da5 100644 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerMovement.cs @@ -5,11 +5,11 @@ using Vector2 = UnityEngine.Vector2; using Vector3 = UnityEngine.Vector3; -namespace DDD +namespace DDD.Restaurant { [RequireComponent(typeof(Rigidbody))] [RequireComponent(typeof(BoxCollider))] - public class RestaurantPlayerMovement : RestaurantCharacterMovement, ICurrentDirection + public class PlayerMovement : CharacterMovement, ICurrentDirection { #region Fields diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerMovement.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerMovement.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Character/Player/PlayerMovement.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController.meta b/Assets/_DDD/_Scripts/Restaurant/Controller.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantEnvironmentController.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/EnvironmentController.cs similarity index 87% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantEnvironmentController.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/EnvironmentController.cs index b45a751c0..bd52b1ee1 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantEnvironmentController.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/EnvironmentController.cs @@ -1,9 +1,9 @@ using System.Threading.Tasks; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - public class RestaurantEnvironmentController : FlowController + public class EnvironmentController : FlowController { private RestaurantEnvironmentState _environmentState; public override Task InitializeController() @@ -31,7 +31,7 @@ public override Task OnExitCurrentFlow(GameFlowState exitingFlowState) private void GenerateDummyEnvironmentProps() { // Make dummy placement data - foreach (EnvironmentData prop in DataManager.Instance.GetDataSo().GetDataList()) + foreach (EnvironmentDataEntry prop in DataManager.Instance.GetDataSo().GetDataList()) { for (int i = 0; i < 10; i++) { diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantEnvironmentController.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/EnvironmentController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantEnvironmentController.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/EnvironmentController.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/GlobalMessageController.cs similarity index 94% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/GlobalMessageController.cs index e43fa0310..1eb99f053 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/GlobalMessageController.cs @@ -3,7 +3,7 @@ namespace DDD { - public class RestaurantGlobalMessageController : FlowController + public class GlobalMessageController : FlowController { private const string ReadyForRestaurantMessageKey = "ready_for_restaurant_message"; private const string RunRestaurantMessageKey = "run_restaurnat_message"; diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/GlobalMessageController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/GlobalMessageController.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantManagementController.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/ManagementController.cs similarity index 89% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantManagementController.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/ManagementController.cs index 0237687fd..c395c5858 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantManagementController.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/ManagementController.cs @@ -1,9 +1,9 @@ using System.Threading.Tasks; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - public class RestaurantManagementController : FlowController + public class ManagementController : FlowController { public override Task InitializeController() { diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantManagementController.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/ManagementController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantManagementController.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/ManagementController.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantPlayerController.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/PlayerController.cs similarity index 93% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantPlayerController.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/PlayerController.cs index 364b53b91..76ab29331 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantPlayerController.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/PlayerController.cs @@ -2,9 +2,9 @@ using System.Threading.Tasks; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - public class RestaurantPlayerController : FlowController + public class PlayerController : FlowController { public override Task InitializeController() { diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantPlayerController.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/PlayerController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantPlayerController.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/PlayerController.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/CustomerFactory.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/CustomerFactory.cs similarity index 68% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/CustomerFactory.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/CustomerFactory.cs index 9131469c6..fadd08e19 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/CustomerFactory.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/CustomerFactory.cs @@ -3,7 +3,7 @@ using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; -namespace DDD +namespace DDD.Restaurant { public interface ICustomerFactory { @@ -14,12 +14,12 @@ public interface ICustomerFactory public interface ICustomerInitializer { - void Initialize(CustomerData customerData); + void Initialize(CustomerDataEntry customerDataEntry); } public struct CustomerSpawnArgs { - public CustomerData CustomerData; + public CustomerDataEntry CustomerDataEntry; public Vector3 Position; public Quaternion Rotation; public Transform Parent; @@ -28,7 +28,6 @@ public struct CustomerSpawnArgs public class CustomerFactory : ICustomerFactory { private GameObject _customerPrefab; - private AsyncOperationHandle _customerPrefabHandle; public async Task CreateAsync(CustomerSpawnArgs args) { @@ -42,7 +41,7 @@ public async Task CreateAsync(CustomerSpawnArgs args) if (newCustomer.TryGetComponent(out ICustomerInitializer initializer)) { - initializer.Initialize(args.CustomerData); + initializer.Initialize(args.CustomerDataEntry); } return newCustomer; } @@ -65,26 +64,13 @@ private async Task LoadCustomerAsset() Debug.LogError("[CustomerFactory] RestaurantCustomerData or its CustomerPrefab reference is not set."); return; } - - _customerPrefabHandle = customerDataAsset.CustomerPrefab.LoadAssetAsync(); - await _customerPrefabHandle.Task; - - if (_customerPrefabHandle.Result == null) - { - Debug.LogError("[CustomerFactory] Failed to load customer prefab from AssetReference."); - return; - } - - _customerPrefab = _customerPrefabHandle.Result; - Debug.Log("[CustomerFactory] Customer prefab loaded successfully."); + + _customerPrefab = await AssetManager.Instance.LoadAssetAsync(customerDataAsset.CustomerPrefab); } public void UnloadAssets() { - if (_customerPrefabHandle.IsValid()) - { - Addressables.Release(_customerPrefabHandle); - } + AssetManager.Instance.ReleaseAsset(RestaurantData.Instance.CustomerData.CustomerPrefab); _customerPrefab = null; Debug.Log("[CustomerFactory] Customer prefab unloaded."); } diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/CustomerFactory.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/CustomerFactory.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/CustomerFactory.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/CustomerFactory.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RandomSpawnScheduleBuilder.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/RegularSpawnScheduleBuilder.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnPointProvider.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnPointProvider.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnPointProvider.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnPointProvider.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnPointProvider.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnPointProvider.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnPointProvider.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnPointProvider.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnSchedule.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnSchedule.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnSchedule.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnSchedule.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnSchedule.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnSchedule.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnSchedule.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnSchedule.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnScheduleUtils.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnScheduleUtils.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnScheduleUtils.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnScheduleUtils.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnScheduleUtils.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnScheduleUtils.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Run/Customer/SpawnScheduleUtils.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Run/Customer/SpawnScheduleUtils.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantRunController.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/RunController.cs similarity index 77% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantRunController.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/RunController.cs index 6bbc05bc3..03db4ea75 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantRunController.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/RunController.cs @@ -5,18 +5,18 @@ using System.Threading.Tasks; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - public class RestaurantRunController : FlowController + public class RunController : FlowController { private RestaurantCustomerState _restaurantCustomerStateSo; private RestaurantRunState _restaurantRunStateSo; private CancellationTokenSource _cts; // Runtime dependencies used by the execution logic - private LevelDataSo _levelDataSo; - private CustomerDataSo _customerDataSo; - private CustomerPoolDataSo _customerPoolDataSo; + private LevelDataAsset _levelDataAsset; + private CustomerDataAsset _customerDataAsset; + private CustomerPoolDataAsset _customerPoolDataAsset; private ICustomerFactory _iCustomerFactory; private ISpawnPointProvider _spawnPointProvider; @@ -71,21 +71,21 @@ public override Task OnExitCurrentFlow(GameFlowState exitingFlowState) private async Task StartSpawnLoopAsync(CancellationToken token) { var currentGameLevel = GameState.Instance.LevelState.Level; - _levelDataSo ??= DataManager.Instance.GetDataSo(); - _customerDataSo ??= DataManager.Instance.GetDataSo(); - _customerPoolDataSo ??= DataManager.Instance.GetDataSo(); + _levelDataAsset ??= DataManager.Instance.GetDataSo(); + _customerDataAsset ??= DataManager.Instance.GetDataSo(); + _customerPoolDataAsset ??= DataManager.Instance.GetDataSo(); - var currentLevelData = _levelDataSo.GetDataList().FirstOrDefault(data => data.Level == currentGameLevel); + var currentLevelData = _levelDataAsset.GetDataList().FirstOrDefault(data => data.Level == currentGameLevel); Debug.Assert(currentLevelData != null, "currentLevelData is null"); if (currentLevelData == null) return; // 안전 가드 - var normalPool = _customerPoolDataSo.GetDataById(currentLevelData.CustomerPool); - var specialPool = _customerPoolDataSo.GetDataById(currentLevelData.SpecialCustomerPool); + var normalPool = _customerPoolDataAsset.GetDataById(currentLevelData.CustomerPool); + var specialPool = _customerPoolDataAsset.GetDataById(currentLevelData.SpecialCustomerPool); await RunSpawnLoopAsync(currentLevelData, normalPool, specialPool, token); } - private async Task RunSpawnLoopAsync(LevelData levelData, CustomerPoolData normalPool, CustomerPoolData specialPool, CancellationToken token) + private async Task RunSpawnLoopAsync(LevelDataEntry levelDataEntry, CustomerPoolDataEntry normalPool, CustomerPoolDataEntry specialPool, CancellationToken token) { var runData = RestaurantData.Instance? RestaurantData.Instance.RunData : null; float firstDelay = Mathf.Max(0f, runData? runData.FirstSpawnDelaySeconds : 5f); @@ -94,7 +94,7 @@ private async Task RunSpawnLoopAsync(LevelData levelData, CustomerPoolData norma await Awaitable.WaitForSecondsAsync(firstDelay, token); } - var scheduleBuilder = CreateBuilder(levelData.SpawnType); + var scheduleBuilder = CreateBuilder(levelDataEntry.SpawnType); int randomSeed = Environment.TickCount; SpawnSchedule MakeSchedule() => scheduleBuilder.Build(new SpawnScheduleBuildArgs @@ -107,7 +107,7 @@ SpawnSchedule MakeSchedule() => scheduleBuilder.Build(new SpawnScheduleBuildArgs }); _spawnSchedule = MakeSchedule(); - float wait = Mathf.Max(0.1f, levelData.CustomerRespawnTime); + float wait = Mathf.Max(0.1f, levelDataEntry.CustomerRespawnTime); while (token.IsCancellationRequested == false) { @@ -118,20 +118,20 @@ SpawnSchedule MakeSchedule() => scheduleBuilder.Build(new SpawnScheduleBuildArgs if (_spawnSchedule.TryDequeue(out var customerId) == false) break; - if (_customerDataSo.TryGetDataById(customerId, out var customerData)) + if (_customerDataAsset.TryGetDataById(customerId, out var customerData)) { var rotation = Quaternion.identity; await _iCustomerFactory.CreateAsync(new CustomerSpawnArgs { - CustomerData = customerData, + CustomerDataEntry = customerData, Position = _restaurantRunStateSo.SpawnPoint, Rotation = rotation, Parent = null }); } - - await Task.Delay(TimeSpan.FromSeconds(wait), token); + + await Awaitable.WaitForSecondsAsync(wait, token); } } diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantRunController.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/RunController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantRunController.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/RunController.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantEnvironment.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantEnvironment.cs similarity index 87% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantEnvironment.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantEnvironment.cs index e8372b8ad..a0812a08a 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantEnvironment.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantEnvironment.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class CreateRestaurantEnvironment : RestaurantFlowTask { @@ -13,7 +13,7 @@ public override Task ReadyFlowTask() public override Task RunFlowTask() { - // TODO : Base prefab from EnvironmentDataSo + // TODO : Base prefab from EnvironmentDataAsset var props = RestaurantState.Instance.EnvironmentState.Props; foreach (var prop in props) diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantEnvironment.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantEnvironment.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantEnvironment.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantEnvironment.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantPlayer.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantPlayer.cs similarity index 97% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantPlayer.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantPlayer.cs index f5ac043ea..3f87d4edd 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantPlayer.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantPlayer.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class CreateRestaurantPlayer : RestaurantFlowTask { diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantPlayer.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantPlayer.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/Conrtollers/Tasks/CreateRestaurantPlayer.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/Conrtollers/Tasks/CreateRestaurantPlayer.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/FlowController.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/FlowController.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/FlowController.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/FlowController.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/FlowController.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/FlowController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/FlowController.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/FlowController.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantController.cs similarity index 92% rename from Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantController.cs index 0069fff33..079143c8c 100644 --- a/Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantController.cs @@ -4,7 +4,7 @@ using UnityEngine; using UnityEngine.AddressableAssets; -namespace DDD +namespace DDD.Restaurant { public class RestaurantController : Singleton, IManager, IGameFlowHandler { @@ -18,11 +18,11 @@ public class RestaurantController : Singleton, IManager, I // static definitions private static readonly List RestaurantFlowControllerTypes = new() { - typeof(RestaurantPlayerController), - typeof(RestaurantEnvironmentController), - typeof(RestaurantManagementController), - typeof(RestaurantRunController), - typeof(RestaurantGlobalMessageController) + typeof(PlayerController), + typeof(EnvironmentController), + typeof(ManagementController), + typeof(RunController), + typeof(GlobalMessageController) }; public void PreInit() diff --git a/Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantController.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/RestaurantController.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantController.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/RestaurantControllerDataSo.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantControllerDataSo.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/RestaurantControllerDataSo.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantControllerDataSo.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/RestaurantControllerDataSo.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantControllerDataSo.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/RestaurantControllerDataSo.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantControllerDataSo.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantController/RestaurantFlowTask.cs b/Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantFlowTask.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/RestaurantFlowTask.cs rename to Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantFlowTask.cs diff --git a/Assets/_DDD/_Scripts/RestaurantController/RestaurantFlowTask.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantFlowTask.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantController/RestaurantFlowTask.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Controller/RestaurantFlowTask.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantData.meta b/Assets/_DDD/_Scripts/Restaurant/Data.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData.meta rename to Assets/_DDD/_Scripts/Restaurant/Data.meta diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects.meta b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects.meta rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects.meta diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantCustomerData.cs b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantCustomerData.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantCustomerData.cs rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantCustomerData.cs diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantCustomerData.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantCustomerData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantCustomerData.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantCustomerData.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantManagementData.cs b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantManagementData.cs similarity index 97% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantManagementData.cs rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantManagementData.cs index 4d9cc6968..205cd272a 100644 --- a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantManagementData.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantManagementData.cs @@ -1,7 +1,7 @@ using Sirenix.OdinInspector; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { [CreateAssetMenu(fileName = "RestaurantManagementData", menuName = "RestaurantData/RestaurantManagementData")] public class RestaurantManagementData : ScriptableObject diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantManagementData.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantManagementData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantManagementData.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantManagementData.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantPlayerData.cs b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantPlayerData.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantPlayerData.cs rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantPlayerData.cs diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantPlayerData.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantPlayerData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantPlayerData.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantPlayerData.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantRunData.cs b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantRunData.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantRunData.cs rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantRunData.cs diff --git a/Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantRunData.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantRunData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/DataObjects/RestaurantRunData.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Data/DataObjects/RestaurantRunData.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Data/RestaurantData.cs b/Assets/_DDD/_Scripts/Restaurant/Data/RestaurantData.cs new file mode 100644 index 000000000..775911e83 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Data/RestaurantData.cs @@ -0,0 +1,57 @@ +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.AddressableAssets; + +namespace DDD.Restaurant +{ + [CreateAssetMenu(fileName = "RestaurantData", menuName = "RestaurantData/RestaurantData", order = 0)] + public class RestaurantData : ScriptSingleton + { + [SerializeField] private AssetReference _restaurantPlayerData; + [SerializeField] private AssetReference _restaurantManagementData; + [SerializeField] private AssetReference _restaurantRunData; + [SerializeField] private AssetReference _restaurantCustomerData; + + public RestaurantPlayerData PlayerData { get; private set; } + public RestaurantManagementData ManagementData { get; private set; } + public RestaurantRunData RunData { get; private set; } + public RestaurantCustomerData CustomerData { get; private set; } + + private bool _isLoaded; + + public async Task LoadData() + { + if (_isLoaded) + { + return; + } + + PlayerData = await AssetManager.Instance.LoadAssetAsync(_restaurantPlayerData); + ManagementData = await AssetManager.Instance.LoadAssetAsync(_restaurantManagementData); + RunData = await AssetManager.Instance.LoadAssetAsync(_restaurantRunData); + CustomerData = await AssetManager.Instance.LoadAssetAsync(_restaurantCustomerData); + + _isLoaded = true; + } + + private void OnDisable() + { + if (_isLoaded == false) return; + + var assetManager = AssetManager.Instance; + if (!assetManager) return; + + AssetManager.Instance.ReleaseAsset(_restaurantPlayerData); + AssetManager.Instance.ReleaseAsset(_restaurantManagementData); + AssetManager.Instance.ReleaseAsset(_restaurantRunData); + AssetManager.Instance.ReleaseAsset(_restaurantCustomerData); + + PlayerData = null; + ManagementData = null; + RunData = null; + CustomerData = null; + + _isLoaded = false; + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantData/RestaurantData.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Data/RestaurantData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantData/RestaurantData.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Data/RestaurantData.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment.meta b/Assets/_DDD/_Scripts/Restaurant/Environment.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/IInteractionSubsystemOwner.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs rename to Assets/_DDD/_Scripts/Restaurant/Environment/IInteractionSubsystemOwner.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/IInteractionSubsystemOwner.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/IInteractionSubsystemOwner.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment/IInteractionSubsystemOwner.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantCookInteractionSubsystem.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs similarity index 88% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantCookInteractionSubsystem.cs rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs index 8853c91ae..c599b2af8 100644 --- a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantCookInteractionSubsystem.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs @@ -9,7 +9,7 @@ public enum RestaurantCookType : uint OpenCookUi = 0, } - public class RestaurantCookInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject + public class InteractionSubsystem_Cook : MonoBehaviour, IInteractionSubsystemObject { [SerializeField] protected RestaurantCookType _cookType = RestaurantCookType.OpenCookUi; diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantCookInteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantCookInteractionSubsystem.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Management.cs similarity index 88% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Management.cs index 0c7dd033c..0bab205bb 100644 --- a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Management.cs @@ -10,7 +10,7 @@ public enum RestaurantManagementType : uint StartRestaurant = 1, } - public class RestaurantManagementInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject + public class InteractionSubsystem_Management : MonoBehaviour, IInteractionSubsystemObject { [SerializeField] protected RestaurantManagementType _managementType = RestaurantManagementType.OpenRestaurantMenu; diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Management.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantManagementInteractionSubsystem.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Management.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantMealInteractionSubsystem.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs similarity index 79% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantMealInteractionSubsystem.cs rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs index d018dc86b..48b1b410d 100644 --- a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantMealInteractionSubsystem.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs @@ -1,4 +1,5 @@ using System; +using Unity.VisualScripting; using UnityEngine; namespace DDD @@ -9,7 +10,7 @@ public enum RestaurantMealType : uint WaitForOrder = 1u, WaitForServe = 1u << 1 } - public class RestaurantMealInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject + public class InteractionSubsystem_Meal : MonoBehaviour, IInteractionSubsystemObject { private RestaurantMealType _currentRestaurantMealType; private void Awake() @@ -23,11 +24,13 @@ public RestaurantMealType GetInteractionSubsystemType() public void SetInteractionSubsystemType(RestaurantMealType inValue) { + Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] SetInteractionSubsystemType {inValue.ToString()}"); _currentRestaurantMealType = inValue; } public void InitializeSubsystem() { + Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] InitializeSubsystem"); _currentRestaurantMealType = RestaurantMealType.None; } @@ -38,6 +41,7 @@ public bool CanInteract() public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) { + Debug.Log($"[{gameObject.GetHashCode()}, {GetType().Name}] OnInteracted"); var prev = _currentRestaurantMealType; _currentRestaurantMealType = GetNextState(prev); return true; diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantMealInteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantMealInteractionSubsystem.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Meal.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Order.cs similarity index 59% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Order.cs index fd6260925..fde3d3f3c 100644 --- a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Order.cs @@ -1,5 +1,6 @@ using System; using UnityEngine; +using UnityEngine.Serialization; namespace DDD { @@ -13,30 +14,40 @@ public enum RestaurantOrderType : uint Dirty = 1u << 4, } - public class RestaurantOrderInteractionSubsystem : MonoBehaviour, IInteractionSubsystemObject + public interface IRestaurantOrderObject { - [SerializeField] protected RestaurantOrderType orderType = RestaurantOrderType.Wait; - private RestaurantOrderType currentRestaurantOrderType; + void TransitionToNextPhase(); + } + + public class InteractionSubsystem_Order : MonoBehaviour, IInteractionSubsystemObject, IRestaurantOrderObject + { + [FormerlySerializedAs("orderType")] [SerializeField] protected RestaurantOrderType _orderType = RestaurantOrderType.Wait; + private RestaurantOrderType _currentRestaurantOrderType; private void Start() { - currentRestaurantOrderType = orderType; + _currentRestaurantOrderType = _orderType; } public bool CanInteract() { - //if (GetInteractionSubsystemType() == RestaurantOrderType.Wait) - //{ - // return true; - //} + if (GetInteractionSubsystemType() == RestaurantOrderType.Wait) + { + return CanTransitionToNextPhase(); + } return true; } + + public void TransitionToNextPhase() + { + // 간단한 상태 전이: 현재 상태에서 다음 상태로 이동 + var currentState = GetInteractionSubsystemType(); + var nextState = GetNextState(currentState); + SetInteractionSubsystemType(nextState); + } public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) { - // 간단한 상태 전이: 현재 상태에서 다음 상태로 이동 - var prev = currentRestaurantOrderType; - currentRestaurantOrderType = GetNextState(prev); return true; } @@ -47,17 +58,17 @@ public ScriptableObject GetPayload() public void InitializeSubsystem() { - currentRestaurantOrderType = orderType; + _currentRestaurantOrderType = _orderType; } public RestaurantOrderType GetInteractionSubsystemType() { - return currentRestaurantOrderType; + return _currentRestaurantOrderType; } public void SetInteractionSubsystemType(RestaurantOrderType inValue) { - currentRestaurantOrderType = inValue; + _currentRestaurantOrderType = inValue; } private RestaurantOrderType GetNextState(RestaurantOrderType state) @@ -73,5 +84,10 @@ private RestaurantOrderType GetNextState(RestaurantOrderType state) default: return RestaurantOrderType.Wait; } } + + public bool CanTransitionToNextPhase() + { + return true; + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Order.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/Interactions/RestaurantOrderInteractionSubsystem.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Order.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/RestaurantEnvironment.cs similarity index 54% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs rename to Assets/_DDD/_Scripts/Restaurant/Environment/RestaurantEnvironment.cs index 344fd6309..6b1ae5890 100644 --- a/Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/RestaurantEnvironment.cs @@ -3,7 +3,7 @@ using Unity.VisualScripting; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class RestaurantEnvironment : MonoBehaviour { @@ -14,49 +14,49 @@ public class RestaurantEnvironment : MonoBehaviour private Transform _visualLook; private Renderer _renderer; - public async void Initialize(RestaurantPropLocation location) + public void Initialize(RestaurantPropLocation location) { - EnvironmentData environmentData = DataManager.Instance.GetDataSo().GetDataById(location.Id); + EnvironmentDataEntry environmentDataEntry = DataManager.Instance.GetDataSo().GetDataById(location.Id); _collider = GetComponent(); _rootObject = transform.Find(CommonConstants.RootObject); _visualLook = _rootObject.Find(CommonConstants.VisualLook); - if (environmentData == null) + if (environmentDataEntry == null) { - Debug.Assert(false, "environmentData is null"); + Debug.Assert(false, "environmentDataEntry is null"); } - if (environmentData.RendererType == RendererType.Sprite) + if (environmentDataEntry.RendererType == RendererType.Sprite) { var spriteRenderer = _visualLook.AddComponent(); _renderer = spriteRenderer; - spriteRenderer.sprite = DataManager.Instance.GetSprite(environmentData.SpriteKey); + spriteRenderer.sprite = DataManager.Instance.GetSprite(environmentDataEntry.SpriteKey); spriteRenderer.sortingOrder = 5; - Material material = await AssetManager.LoadAsset(DataConstants.BasePropSpriteMaterial); - spriteRenderer.material = new Material(material); + //Material material = await AssetManager.LoadAssetAsync(DataConstants.BasePropSpriteMaterial); + //spriteRenderer.material = new Material(material); } - else if (environmentData.RendererType == RendererType.Spine) + else if (environmentDataEntry.RendererType == RendererType.Spine) { var skeletonAnimation = _visualLook.AddComponent(); - var skeletonDataAsset = await AssetManager.LoadAsset(environmentData.SkeletonDataName); - skeletonAnimation.skeletonDataAsset = skeletonDataAsset; + //var skeletonDataAsset = await AssetManager.LoadAssetAsync(environmentDataEntry.SkeletonDataName); + //skeletonAnimation.skeletonDataAsset = skeletonDataAsset; var spineController = transform.AddComponent(); - spineController.SetSkin(environmentData.SkinName); - spineController.PlayAnimation(environmentData.DefaultAnimationName, true); + spineController.SetSkin(environmentDataEntry.SkinName); + spineController.PlayAnimation(environmentDataEntry.DefaultAnimationName, true); _renderer = _visualLook.GetComponent(); } - _collider.isTrigger = environmentData.IsTrigger == 1; + _collider.isTrigger = environmentDataEntry.IsTrigger == 1; transform.position = new Vector3(location.Position.x, 0f, location.Position.y); - transform.localScale = Vector3.one * environmentData.Size; + transform.localScale = Vector3.one * environmentDataEntry.Size; // Interaction initialize - if (environmentData.InteractionType != InteractionType.None) + if (environmentDataEntry.InteractionType != InteractionType.None) { var interactionComponent = transform.AddComponent(); - interactionComponent.InitializeInteraction(environmentData.InteractionType); + interactionComponent.InitializeInteraction(environmentDataEntry.InteractionType); } } } diff --git a/Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Environment/RestaurantEnvironment.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEnvironment/RestaurantEnvironment.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Environment/RestaurantEnvironment.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent.meta b/Assets/_DDD/_Scripts/Restaurant/Event.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent.meta rename to Assets/_DDD/_Scripts/Restaurant/Event.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Cosmetic.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Cosmetic.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Cosmetic/InteractableHighlight.cs similarity index 99% rename from Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Cosmetic/InteractableHighlight.cs index 1ba96248e..8d6272b14 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Cosmetic/InteractableHighlight.cs @@ -4,7 +4,7 @@ using QualityLevel = HighlightPlus.QualityLevel; using HighlightPlus; -namespace DDD +namespace DDD.Restaurant { public enum InteractionOutlineType { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Cosmetic/InteractableHighlight.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Cosmetic/InteractableHighlight.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Cosmetic/InteractableHighlight.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantEvents.cs b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantEvents.cs new file mode 100644 index 000000000..19d3c4f8c --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantEvents.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace DDD.Restaurant +{ + public static class RestaurantEvents + { + public static ItemSlotSelectedEvent ItemSlotSelectedEvent = new(); + public static TodayMenuAddedEvent TodayMenuAddedEvent = new(); + public static TodayMenuRemovedEvent TodayMenuRemovedEvent = new(); + + public static RestaurantInteractionEvent InteractionEvent = new(); + } + + #region RestaurantInteractionEvents + public class ItemSlotSelectedEvent : IEvent + { + public ItemModel Model; + } + public class TodayMenuAddedEvent : IEvent {} + + public class TodayMenuRemovedEvent : IEvent + { + public InventoryCategoryType InventoryCategoryType; + } + #endregion +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantEvents.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantEvents.cs.meta new file mode 100644 index 000000000..9606be7c7 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantEvents.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 23743115320e4bf2a1001c64e92d4a53 +timeCreated: 1756277677 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs similarity index 87% rename from Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs index 48a3e4e86..422daa866 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs @@ -5,15 +5,14 @@ using UnityEngine; using Sirenix.OdinInspector; -namespace DDD +namespace DDD.Restaurant { public static class RestaurantInteractionSubsystems { public static Dictionary TypeToSubsystem = new() { - {InteractionType.RestaurantOrder, typeof(RestaurantOrderInteractionSubsystem)}, - {InteractionType.RestaurantManagement, typeof(RestaurantManagementInteractionSubsystem)}, - {InteractionType.RestaurantMeal, typeof(RestaurantMealInteractionSubsystem)} + {InteractionType.RestaurantOrder, typeof(InteractionSubsystem_Order)}, + {InteractionType.RestaurantManagement, typeof(InteractionSubsystem_Management)}, }; } @@ -75,20 +74,9 @@ public virtual bool IsInteractionHidden() return flowDisabled; } - public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payload = null) + public virtual void OnInteracted(IInteractor interactor, ScriptableObject payload = null) { - if (CanInteract() == false) - { - return false; - } - - bool interactionResult = RestaurantInteractionEvents.RestaurantInteraction.RequestInteraction(interactor.GetInteractorGameObject(), - GetInteractableGameObject(), GetInteractionType(), payload, true); - if (HasSubsystem(_interactionType)) - { - interactionResult &= GetSubsystem(_interactionType).OnInteracted(interactor, payload); - } - return interactionResult; + // TODO : Do Something cosmetic? } public virtual InteractionType GetInteractionType() diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionComponent.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionComponent.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionEvents.cs similarity index 81% rename from Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionEvents.cs index 4c835ec2d..f006c3e85 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionEvents.cs @@ -2,22 +2,20 @@ using System.Collections.Generic; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { - public static class RestaurantInteractionEvents - { - public static RestaurantInteractionEvent RestaurantInteraction = new(); - } - public static class RestaurantInteractionEventSolvers { public static Dictionary TypeToSolver = new() { {InteractionType.RestaurantManagement, typeof(RestaurantManagementSolver)}, {InteractionType.RestaurantOrder, typeof(RestaurantOrderSolver)}, - {InteractionType.RestaurantMeal, typeof(RestaurantMealSolver)}, {InteractionType.RestaurantCook, typeof(RestaurantCookSolver)} }; + public static Dictionary TypeToPlayerSolver = new() + { + {InteractionType.RestaurantOrder, typeof(RestaurantOrderPlayerSolver)}, + }; } public class RestaurantInteractionEvent : IEvent @@ -59,7 +57,15 @@ public bool RequestInteraction(GameObject causer, GameObject target, Interaction // Cast solverComponent to IInteractable if (solver is not null && interactor is not null) { - evt.EventResult = solver.ExecuteInteraction(interactor, interactable, payload); + bool canExecute = solver.CanExecuteInteraction(interactor, interactable, payload); + if (canExecute) + { + evt.EventResult = solver.ExecuteInteraction(interactor, interactable, payload); + } + else + { + evt.EventResult = false; + } } else { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionEvents.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/RestaurantInteractionEvents.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/RestaurantInteractionEvents.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver.cs similarity index 95% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver.cs index dad15780b..dd79eb368 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace DDD +namespace DDD.Restaurant { public static class RestaurantCookSolvers { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs similarity index 97% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs index 4214524ab..3bcf4f904 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class RestaurantCookSolver_OpenCookUi : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver.cs similarity index 96% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver.cs index 92e3ce5c5..1d0137d14 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace DDD +namespace DDD.Restaurant { public class RestaurantManagementSolver : RestaurantSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs similarity index 97% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs index 73005e436..a6f7dad87 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class RestaurantManagementSolver_Menu : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Menu.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs similarity index 97% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs index a54d51579..f6f0e6fb5 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class RestaurantManagementSolver_Start : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantManagements/RestaurantManagementSolver_Start.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForOrder.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantMeals/RestaurantMealSolver_WaitForServe.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver.cs similarity index 70% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver.cs index 71d8149fa..b752ebdda 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using DDD.RestaurantOrders; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class RestaurantOrderSolver : RestaurantSubsystemSolver { @@ -11,9 +10,19 @@ public class RestaurantOrderSolver : RestaurantSubsystemSolver GetSubsystemSolverTypeMappings() + { + return _typeToOrderSolver; + } + } + public class RestaurantOrderPlayerSolver : RestaurantSubsystemSolver + { + private Dictionary _typeToOrderSolver = new() + { { RestaurantOrderType.Order, typeof(RestaurantOrderSolver_Order) }, { RestaurantOrderType.Serve, typeof(RestaurantOrderSolver_Serve) }, - { RestaurantOrderType.Busy, typeof(RestaurantOrderSolver_Busy) }, { RestaurantOrderType.Dirty, typeof(RestaurantOrderSolver_Dirty) } }; protected override Dictionary GetSubsystemSolverTypeMappings() diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs similarity index 95% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs index 653658f12..02e49b9bb 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD.RestaurantOrders +namespace DDD.Restaurant { public class RestaurantOrderSolver_Busy : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Busy.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs similarity index 94% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs index c1d6751d3..465f24f90 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD.RestaurantOrders +namespace DDD.Restaurant { public class RestaurantOrderSolver_Dirty : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Dirty.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs similarity index 94% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs index 0d749254f..476b5f0bb 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD.RestaurantOrders +namespace DDD.Restaurant { public class RestaurantOrderSolver_Order : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Order.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs similarity index 95% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs index 04583c485..a6556a78f 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD.RestaurantOrders +namespace DDD.Restaurant { public class RestaurantOrderSolver_Reserved : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Reserved.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs similarity index 94% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs index 79407afc9..bbcf1d1d8 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD.RestaurantOrders +namespace DDD.Restaurant { public class RestaurantOrderSolver_Serve : MonoBehaviour, IInteractionSubsystemSolver { diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Serve.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs similarity index 58% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs index 45dac052c..62dc989e4 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs @@ -1,18 +1,23 @@ using Opsive.BehaviorDesigner.Runtime.Tasks; using UnityEngine; -namespace DDD.RestaurantOrders +namespace DDD.Restaurant { public class RestaurantOrderSolver_Wait : MonoBehaviour, IInteractionSubsystemSolver { public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payload = null) { if (CanExecuteInteractionSubsystem(interactor, interactable, payload) == false) return false; - // TODO : DO SOMETHING!!! - /* TODO - * OnInteracted에서 상태를 바꾸는 대신, 여기서 직접 바꿔주고, 현재 나에게 점유되어 있다는 사실을 알려주기? 그리고 CanInteractTo에서 이게 일치해야만 참 반환하게? - * 필요하다면 IInteractable 인터페이스에 CurrentInteractor를 등록하는 메소드를 추가해야 할수도? - */ + + if (interactable is not IInteractionSubsystemOwner subsystemOwner) + return false; + if (!subsystemOwner.TryGetSubsystemObject(out var subsystem)) + return false; + if (subsystem is IRestaurantOrderObject orderObject) + { + orderObject.TransitionToNextPhase(); + } + return true; } diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantOrders/RestaurantOrderSolver_Wait.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantSubsystemSolver.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantSubsystemSolver.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantSubsystemSolver.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantSubsystemSolver.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantSubsystemSolver.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState.meta b/Assets/_DDD/_Scripts/Restaurant/State.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState.meta rename to Assets/_DDD/_Scripts/Restaurant/State.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates.meta b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates.meta rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantCustomerState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantCustomerState.cs similarity index 79% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantCustomerState.cs rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantCustomerState.cs index b18f09bbe..5f8bd2f1a 100644 --- a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantCustomerState.cs +++ b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantCustomerState.cs @@ -1,17 +1,15 @@ using System.Collections.Generic; using System.Threading.Tasks; using Opsive.BehaviorDesigner.Runtime; -using Sirenix.OdinInspector; using UnityEngine; using UnityEngine.AddressableAssets; -using UnityEngine.ResourceManagement.AsyncOperations; -namespace DDD +namespace DDD.Restaurant { public class RestaurantCustomerState : ScriptableObject { - private Dictionary _loadedSubtrees = new Dictionary(); - private Dictionary> _subtreeHandles = new Dictionary>(); + private Dictionary _loadedSubtrees = new(); + private Dictionary _subtreeAssetReference = new(); public async Task LoadCustomerBehaviorData() { @@ -40,14 +38,12 @@ public async Task LoadCustomerBehaviorData() private async Task LoadSubtreeAsync(CustomerType customerType, AssetReference subtreeReference) { - var handle = Addressables.LoadAssetAsync(subtreeReference); - _subtreeHandles[customerType] = handle; - - await handle.Task; - - if (handle.Result != null) + var subtree = await AssetManager.Instance.LoadAssetAsync(subtreeReference); + + if (subtree != null) { - _loadedSubtrees[customerType] = handle.Result; + _loadedSubtrees[customerType] = subtree; + _subtreeAssetReference[customerType] = subtreeReference; Debug.Log($"[RestaurantCustomerState] Loaded subtree for {customerType}"); } else @@ -58,16 +54,13 @@ private async Task LoadSubtreeAsync(CustomerType customerType, AssetReference su public void UnloadCustomerBehaviorData() { - foreach (var handle in _subtreeHandles.Values) + foreach (var assetReference in _subtreeAssetReference.Values) { - if (handle.IsValid()) - { - Addressables.Release(handle); - } + AssetManager.Instance.ReleaseAsset(assetReference); } _loadedSubtrees.Clear(); - _subtreeHandles.Clear(); + _subtreeAssetReference.Clear(); Debug.Log("[RestaurantCustomerState] Unloaded all customer behavior subtrees"); } diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantCustomerState.cs.meta b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantCustomerState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantCustomerState.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantCustomerState.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantEnvironmentState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantEnvironmentState.cs rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantEnvironmentState.cs.meta b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantEnvironmentState.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantEnvironmentState.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs similarity index 90% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementState.cs rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs index 330546a47..189ebb88d 100644 --- a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementState.cs +++ b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs @@ -3,7 +3,7 @@ using Sirenix.OdinInspector; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class RestaurantManagementState : ScriptableObject { @@ -79,7 +79,7 @@ public bool TryAddTodayMenu(ItemModel model) if (model.ItemType != ItemType.Recipe) return false; - if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeData recipeData) == false) return false; + if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeDataEntry recipeData) == false) return false; bool added = false; @@ -87,7 +87,7 @@ public bool TryAddTodayMenu(ItemModel model) { if (_todayFoodRecipeIds.Count >= GetRestaurantManagementData().MaxFoodCount || _todayFoodRecipeIds.ContainsKey(recipeId)) return false; - var foodData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); + var foodData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); var craftableCount = foodData.GetCraftableCount(); foodData.ConsumeAllCraftableIngredients(); @@ -98,7 +98,7 @@ public bool TryAddTodayMenu(ItemModel model) { if (_todayDrinkRecipeIds.Count >= GetRestaurantManagementData().MaxDrinkCount || _todayDrinkRecipeIds.ContainsKey(recipeId)) return false; - var drinkData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); + var drinkData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); var craftableCount = drinkData.GetCraftableCount(); drinkData.ConsumeAllCraftableIngredients(); @@ -128,7 +128,7 @@ public bool TryRemoveTodayMenu(ItemModel model) string recipeId = model.Id; var removedEvt = RestaurantEvents.TodayMenuRemovedEvent; - if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeData recipeData) == false) return false; + if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out RecipeDataEntry recipeData) == false) return false; bool removed = false; int refundCount = 0; @@ -142,7 +142,7 @@ public bool TryRemoveTodayMenu(ItemModel model) if (removed) { - var foodData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); + var foodData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); foodData.RefundIngredients(refundCount); } } @@ -156,7 +156,7 @@ public bool TryRemoveTodayMenu(ItemModel model) if (removed) { - var drinkData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); + var drinkData = DataManager.Instance.GetDataSo().GetDataById(recipeData.RecipeResult); drinkData.RefundIngredients(refundCount); } } @@ -183,7 +183,7 @@ public bool TryAddTodayCookware(ItemModel model) { var cookwareId = model.Id; - if (model.HasItem == false || DataManager.Instance.GetDataSo().ContainsData(cookwareId) == false) return false; + if (model.HasItem == false || DataManager.Instance.GetDataSo().ContainsData(cookwareId) == false) return false; if (_cookwareToRecipeIds.Count >= GetRestaurantManagementData().MaxCookwareCount || _cookwareToRecipeIds.ContainsKey(cookwareId)) return false; @@ -212,7 +212,7 @@ public bool TryRemoveTodayCookware(ItemModel model) { var cookwareId = model.Id; - if (DataManager.Instance.GetDataSo().ContainsData(cookwareId) == false) return false; + if (DataManager.Instance.GetDataSo().ContainsData(cookwareId) == false) return false; if (_cookwareToRecipeIds.Remove(cookwareId) == false) return false; @@ -228,14 +228,14 @@ public bool TryRemoveTodayCookware(ItemModel model) private string GetRequiredCookwareKey(string recipeId) { - if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out var recipeData) == false) return null; + if (DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out var recipeData) == false) return null; var resultKey = recipeData.RecipeResult; return recipeData.RecipeType switch { - RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, - RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, + RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, + RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, _ => null }; } diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementState.cs.meta b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementState.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantPlayerState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantPlayerState.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantPlayerState.cs rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantPlayerState.cs diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantPlayerState.cs.meta b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantPlayerState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantPlayerState.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantPlayerState.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantRunState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantRunState.cs similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantRunState.cs rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantRunState.cs diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantRunState.cs.meta b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantRunState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantRunState.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantRunState.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantState/RestaurantState.cs b/Assets/_DDD/_Scripts/Restaurant/State/RestaurantState.cs similarity index 98% rename from Assets/_DDD/_Scripts/RestaurantState/RestaurantState.cs rename to Assets/_DDD/_Scripts/Restaurant/State/RestaurantState.cs index 1855bd5eb..560860472 100644 --- a/Assets/_DDD/_Scripts/RestaurantState/RestaurantState.cs +++ b/Assets/_DDD/_Scripts/Restaurant/State/RestaurantState.cs @@ -1,4 +1,4 @@ -namespace DDD +namespace DDD.Restaurant { public class RestaurantState : ScriptSingleton { diff --git a/Assets/_DDD/_Scripts/RestaurantState/RestaurantState.cs.meta b/Assets/_DDD/_Scripts/Restaurant/State/RestaurantState.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/RestaurantState/RestaurantState.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/State/RestaurantState.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui.meta b/Assets/_DDD/_Scripts/Restaurant/Ui.meta new file mode 100644 index 000000000..1505e0786 --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Ui.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5bf3db4e1b1c49e1be969c4b9d454e70 +timeCreated: 1756279352 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/AddedCookSlotUiStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/AddedCookSlotUiStrategy.cs similarity index 98% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/AddedCookSlotUiStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/AddedCookSlotUiStrategy.cs index c53aa7554..917afd3ce 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/AddedCookSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/AddedCookSlotUiStrategy.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class AddedCookSlotUiStrategy : IItemSlotUiStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/AddedCookSlotUiStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/AddedCookSlotUiStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/AddedCookSlotUiStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/AddedCookSlotUiStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs similarity index 99% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs index 28aa2f1bd..8c0b35837 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs @@ -7,7 +7,7 @@ using UnityEngine.Localization.Components; using UnityEngine.UI; -namespace DDD +namespace DDD.Restaurant { [RequireComponent(typeof(CookViewModel))] public class CookUi : PopupUi diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookViewModel.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs similarity index 95% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookViewModel.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs index 382343373..d4b6e08ee 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookViewModel.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs @@ -4,7 +4,7 @@ using UnityEngine; using UnityEngine.Localization; -namespace DDD +namespace DDD.Restaurant { public class SelectedCookSnapshot { @@ -13,12 +13,12 @@ public class SelectedCookSnapshot public Sprite CookIcon { get; } public string CookPrice { get; } public IReadOnlyList IngredientEntries { get; } - public IReadOnlyList Tastes { get; } + public IReadOnlyList Tastes { get; } public Material TasteMaterial { get; } public SelectedCookSnapshot(LocalizedString name, LocalizedString description, Sprite cookIcon, string cookPrice, IReadOnlyList ingredientEntries, - IReadOnlyList tastes, Material tasteMaterial) + IReadOnlyList tastes, Material tasteMaterial) { Name = name; Description = description; @@ -35,7 +35,7 @@ public SelectedCookSnapshot(LocalizedString name, cookIcon: null, cookPrice: null, ingredientEntries: null, - tastes: System.Array.Empty(), + tastes: System.Array.Empty(), tasteMaterial: null); } @@ -89,7 +89,7 @@ public void SetCookwareType(CookwareType cookwareType) if (_currentCookwareType == cookwareType) return; _currentCookwareType = cookwareType; - var cookwareDatas = DataManager.Instance.GetDataSo().GetDataList(); + var cookwareDatas = DataManager.Instance.GetDataSo().GetDataList(); var cookwareKey = cookwareDatas.Find(data => data.CookwareType == cookwareType).Id; CookwareIcon = DataManager.Instance.GetIcon(cookwareKey); CookwareName = LocalizationManager.Instance.GetLocalizedName(cookwareKey); @@ -119,7 +119,7 @@ public void CreateAddedCookItemSlot(Transform parent) var cookwareId = cookwareToRecipe.Key; var recipeIds = cookwareToRecipe.Value; - if (DataManager.Instance.GetDataSo().TryGetDataById(cookwareId, out var cookwareData) && + if (DataManager.Instance.GetDataSo().TryGetDataById(cookwareId, out var cookwareData) && cookwareData.CookwareType == _currentCookwareType) { foreach (var recipeId in recipeIds) @@ -174,7 +174,7 @@ public void CreateIngredientInventoryItemSlot(Transform parent) // } // else // { - // if (DataManager.Instance.GetDataSo().TryGetDataById(model.Id, out var cookwareData)) + // if (DataManager.Instance.GetDataSo().TryGetDataById(model.Id, out var cookwareData)) // { // interactor.Initialize(TodayMenuEventType.Add, new TodayCookwareInteractorStrategy()); // } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookViewModel.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/CookViewModel.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/SelectedIngredient.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/SelectedIngredient.cs similarity index 96% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/SelectedIngredient.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/SelectedIngredient.cs index b5c77f988..04ebaff98 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/SelectedIngredient.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/SelectedIngredient.cs @@ -1,7 +1,7 @@ using UnityEngine; using UnityEngine.UI; -namespace DDD +namespace DDD.Restaurant { public class SelectedIngredient : MonoBehaviour { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/SelectedIngredient.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/SelectedIngredient.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/CookUi/SelectedIngredient.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/SelectedIngredient.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs new file mode 100644 index 000000000..817d2635c --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace DDD.Restaurant +{ + public class PropUiDisplayComponent : MonoBehaviour + { + + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs.meta new file mode 100644 index 000000000..2b5b6d8ec --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/PropUiDisplayComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 37e749c7ec5440d587f83c715f29ca8f +timeCreated: 1756353198 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistData.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistData.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistData.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistData.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistData.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistData.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistData.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistData.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistView.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistView.cs similarity index 86% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistView.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistView.cs index c2a6d0038..e5e3c39e3 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistView.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistView.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public enum ChecklistLocalizationKey { @@ -42,7 +42,7 @@ public void UpdateView() _viewModel.UpdateChecklistView(); } - public void Invoke(TodayMenuRemovedEvent evt) => UpdateView(); - public void Invoke(TodayMenuAddedEvent evt) => UpdateView(); + public void HandleEvent(TodayMenuRemovedEvent evt) => UpdateView(); + public void HandleEvent(TodayMenuAddedEvent evt) => UpdateView(); } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistView.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistView.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ChecklistView.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ChecklistView.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs similarity index 92% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs index ac018625f..6275ee513 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs @@ -29,15 +29,15 @@ public static List ExtractIngredients(params string[] values) return list; } - public static List ResolveTasteDatas(string[] tasteKeys, TasteDataSo tasteSo) + public static List ResolveTasteDatas(string[] tasteKeys, TasteDataAsset tasteAsset) { - var result = new List(); + var result = new List(); foreach (var key in tasteKeys) { if (string.IsNullOrWhiteSpace(key)) continue; - if (tasteSo.TryGetDataById(key, out var taste)) + if (tasteAsset.TryGetDataById(key, out var taste)) { result.Add(taste); } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/CraftingHelper.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs new file mode 100644 index 000000000..da00d7b3a --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; + +namespace DDD +{ + public static class DrinkDataExtensions + { + public static List GetIngredients(this DrinkDataEntry dataEntry) + => CraftingHelper.ExtractIngredients( + dataEntry.IngredientKey1, dataEntry.IngredientAmount1, + dataEntry.IngredientKey2, dataEntry.IngredientAmount2, + dataEntry.IngredientKey3, dataEntry.IngredientAmount3, + dataEntry.IngredientKey4, dataEntry.IngredientAmount4 + ); + + public static List GetTasteDatas(this DrinkDataEntry dataEntry) + => CraftingHelper.ResolveTasteDatas( + new[] { dataEntry.TasteKey1, dataEntry.TasteKey2, dataEntry.TasteKey3, dataEntry.TasteKey4, dataEntry.TasteKey5, dataEntry.TasteKey6 }, + DataManager.Instance.GetDataSo() + ); + + public static int GetCraftableCount(this DrinkDataEntry dataEntry) + => CraftingHelper.GetCraftableCount(dataEntry.GetIngredients()); + + public static bool TryConsumeIngredients(this DrinkDataEntry dataEntry, int count = 1) + => CraftingHelper.TryConsumeIngredients(dataEntry.GetIngredients(), count); + + public static int ConsumeAllCraftableIngredients(this DrinkDataEntry dataEntry) + { + var ingredients = dataEntry.GetIngredients(); + int count = CraftingHelper.GetCraftableCount(ingredients); + return CraftingHelper.ConsumeAll(ingredients, count); + } + + public static void RefundIngredients(this DrinkDataEntry dataEntry, int count = 1) + => CraftingHelper.RefundIngredients(dataEntry.GetIngredients(), count); + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/DrinkDataExtensions.cs.meta diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs new file mode 100644 index 000000000..491d6923c --- /dev/null +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; + +namespace DDD +{ + public static class FoodDataExtensions + { + public static List GetIngredients(this FoodDataEntry dataEntry) => CraftingHelper.ExtractIngredients( + dataEntry.IngredientKey1, dataEntry.IngredientAmount1, + dataEntry.IngredientKey2, dataEntry.IngredientAmount2, + dataEntry.IngredientKey3, dataEntry.IngredientAmount3, + dataEntry.IngredientKey4, dataEntry.IngredientAmount4 + ); + + public static List GetTasteDatas(this FoodDataEntry dataEntry) + => CraftingHelper.ResolveTasteDatas( + new[] { dataEntry.TasteKey1, dataEntry.TasteKey2, dataEntry.TasteKey3, dataEntry.TasteKey4, dataEntry.TasteKey5, dataEntry.TasteKey6 }, + DataManager.Instance.GetDataSo() + ); + + public static int GetCraftableCount(this FoodDataEntry dataEntry) + => CraftingHelper.GetCraftableCount(dataEntry.GetIngredients()); + + public static bool TryConsumeIngredients(this FoodDataEntry dataEntry, int count = 1) + => CraftingHelper.TryConsumeIngredients(dataEntry.GetIngredients(), count); + + public static int ConsumeAllCraftableIngredients(this FoodDataEntry dataEntry) + { + var ingredients = dataEntry.GetIngredients(); + int count = CraftingHelper.GetCraftableCount(ingredients); + return CraftingHelper.ConsumeAll(ingredients, count); + } + + public static void RefundIngredients(this FoodDataEntry dataEntry, int count = 1) + => CraftingHelper.RefundIngredients(dataEntry.GetIngredients(), count); + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ExtensionsUi/FoodDataExtensions.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs similarity index 98% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs index 07e5b052e..dacc9a703 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class InventorySlotUiStrategy : IItemSlotUiStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventorySlotUiStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventoryView.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventoryView.cs similarity index 90% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventoryView.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventoryView.cs index 31f3f85b3..3f14f03ad 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventoryView.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventoryView.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class InventoryView : MonoBehaviour, IUiView, IEventHandler, IEventHandler, IEventHandler @@ -48,17 +48,17 @@ public void UpdateView() public void UpdateCategoryView(InventoryCategoryType category) => _viewModel.UpdateCategoryViewByCategory(category); - public void Invoke(TodayMenuAddedEvent evt) + public void HandleEvent(TodayMenuAddedEvent evt) { UpdateView(); } - public void Invoke(TodayMenuRemovedEvent evt) + public void HandleEvent(TodayMenuRemovedEvent evt) { UpdateView(); } - public void Invoke(InventoryChangedEvent evt) + public void HandleEvent(InventoryChangedEvent evt) { _viewModel.OnInventoryChanged(); } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventoryView.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventoryView.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/InventoryUi/InventoryView.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/InventoryUi/InventoryView.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemDetailView.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemDetailView.cs similarity index 96% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemDetailView.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemDetailView.cs index c25d7869f..4320bfa2a 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemDetailView.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemDetailView.cs @@ -6,7 +6,7 @@ using UnityEngine.Localization.Components; using UnityEngine.UI; -namespace DDD +namespace DDD.Restaurant { public sealed class ItemDetailSnapshot { @@ -16,7 +16,7 @@ public sealed class ItemDetailSnapshot public Sprite CookwareSprite { get; } public LocalizedString Name { get; } public LocalizedString Description { get; } - public IReadOnlyList Tastes { get; } + public IReadOnlyList Tastes { get; } public Material TasteMaterial { get; } public ItemDetailSnapshot( @@ -26,7 +26,7 @@ public ItemDetailSnapshot( Sprite cookwareSprite, LocalizedString name, LocalizedString description, - IReadOnlyList tastes, + IReadOnlyList tastes, Material tasteMaterial) { BackgroundSprite = backgroundSprite; @@ -46,7 +46,7 @@ public ItemDetailSnapshot( cookwareSprite: null, name: null, description: null, - tastes: System.Array.Empty(), + tastes: System.Array.Empty(), tasteMaterial: null); } @@ -159,7 +159,7 @@ private void ClearHashTags() Utils.DestroyAllChildren(_tasteHashTagContent2); } - public void Invoke(ItemSlotSelectedEvent evt) + public void HandleEvent(ItemSlotSelectedEvent evt) { _viewModel.SetSelectedItem(evt.Model); UpdateView(); diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemDetailView.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemDetailView.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemDetailView.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemDetailView.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IInteractableUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IInteractableUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IInteractableUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IInteractableUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IInteractableUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IInteractableUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IInteractableUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IInteractableUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs similarity index 86% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs index b1167debe..62fad7e24 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs @@ -1,4 +1,4 @@ -namespace DDD +namespace DDD.Restaurant { public interface IItemSlotInteractorStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotInteractorStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs similarity index 88% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs index 8cb6a32b0..c22f38289 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public interface IItemSlotUiStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IItemSlotUiStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IngredientEntry.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IngredientEntry.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IngredientEntry.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IngredientEntry.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IngredientEntry.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IngredientEntry.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/IngredientEntry.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/IngredientEntry.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemModel.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemModel.cs similarity index 81% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemModel.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemModel.cs index 4db0f3964..90f2892a7 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemModel.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemModel.cs @@ -27,18 +27,18 @@ public ItemModel(string id, ItemType itemType) public bool HasItem => Count > 0; public string DisplayName => LocalizationManager.Instance.GetName(Id); - public RecipeType RecipeType => ItemType == ItemType.Recipe ? DataManager.Instance.GetDataSo().GetDataById(Id).RecipeType : RecipeType.None; + public RecipeType RecipeType => ItemType == ItemType.Recipe ? DataManager.Instance.GetDataSo().GetDataById(Id).RecipeType : RecipeType.None; public Sprite ItemSprite { get { if (ItemType == ItemType.Recipe) { - DataManager.Instance.GetDataSo().TryGetDataById(Id, out var recipe); + DataManager.Instance.GetDataSo().TryGetDataById(Id, out var recipe); return DataManager.Instance.GetSprite(recipe.RecipeResult); } - if (DataManager.Instance.GetDataSo().ContainsData(Id)) + if (DataManager.Instance.GetDataSo().ContainsData(Id)) { return DataManager.Instance.GetIcon(Id); } @@ -52,7 +52,7 @@ public string GetRecipeResultKey { if (ItemType != ItemType.Recipe) return null; - return DataManager.Instance.GetDataSo().GetDataById(Id).RecipeResult; + return DataManager.Instance.GetDataSo().GetDataById(Id).RecipeResult; } } @@ -65,8 +65,8 @@ public string GetCookwareKey return RecipeType switch { - RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, - RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, + RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, + RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey, _ => null }; } @@ -81,8 +81,8 @@ public int GetPrice return RecipeType switch { - RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).Price, - RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).Price, + RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).Price, + RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().GetDataById(resultKey).Price, _ => -1 }; } @@ -98,11 +98,11 @@ public Sprite GetCookwareIcon string cookwareKey = null; if (RecipeType == RecipeType.FoodRecipe) { - cookwareKey = DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey; + cookwareKey = DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey; } else if (RecipeType == RecipeType.DrinkRecipe) { - cookwareKey = DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey; + cookwareKey = DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey; } return DataManager.Instance.GetIcon(cookwareKey); } @@ -117,25 +117,25 @@ public List GetIngredients switch (RecipeType) { case RecipeType.FoodRecipe: - return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetIngredients(); + return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetIngredients(); case RecipeType.DrinkRecipe: - return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetIngredients(); + return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetIngredients(); } return null; } } - public List GetTasteDatas + public List GetTasteDatas { get { switch (RecipeType) { case RecipeType.FoodRecipe: - return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetTasteDatas(); + return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetTasteDatas(); case RecipeType.DrinkRecipe: - return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetTasteDatas(); + return DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).GetTasteDatas(); } return null; @@ -153,12 +153,12 @@ public void UpdateCount() if (RecipeType == RecipeType.FoodRecipe) { - var foodData = DataManager.Instance.GetDataSo().GetDataById(resultKey); + var foodData = DataManager.Instance.GetDataSo().GetDataById(resultKey); craftableCount = foodData.GetCraftableCount(); } else if (RecipeType == RecipeType.DrinkRecipe) { - var drinkData = DataManager.Instance.GetDataSo().GetDataById(resultKey); + var drinkData = DataManager.Instance.GetDataSo().GetDataById(resultKey); craftableCount = drinkData.GetCraftableCount(); } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemModel.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemModel.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemModel.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemModel.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs index 616e640ce..89bd9199b 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public enum TodayMenuEventType { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotInteractor.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotUi.cs similarity index 99% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotUi.cs index eafc0343e..98fcf3bf3 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotUi.cs @@ -4,7 +4,7 @@ using UnityEngine.EventSystems; using UnityEngine.UI; -namespace DDD +namespace DDD.Restaurant { [RequireComponent(typeof(CommonButton))] public class ItemSlotUi : MonoBehaviour, ISelectHandler, IAutoScrollItem diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemSlotUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemSlotUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs similarity index 88% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs index 621d8c10a..4b9be19ca 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs @@ -33,16 +33,16 @@ public static List CreateRestaurantManagementInventoryItem() private static int CalculateCraftableCount(string recipeId) { - if (!DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out var recipe)) return 0; + if (!DataManager.Instance.GetDataSo().TryGetDataById(recipeId, out var recipe)) return 0; string recipeResult = recipe.RecipeResult; return recipe.RecipeType switch { - RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().TryGetDataById(recipeResult, out var food) + RecipeType.FoodRecipe => DataManager.Instance.GetDataSo().TryGetDataById(recipeResult, out var food) ? food.GetCraftableCount() : 0, - RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().TryGetDataById(recipeResult, out var drink) + RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo().TryGetDataById(recipeResult, out var drink) ? drink.GetCraftableCount() : 0, _ => 0 @@ -51,7 +51,7 @@ private static int CalculateCraftableCount(string recipeId) public static ItemModel CreateByItemId(string itemId) { - var itemSo = DataManager.Instance.GetDataSo(); + var itemSo = DataManager.Instance.GetDataSo(); if (!itemSo.TryGetDataById(itemId, out var itemData)) return null; if (InventoryManager.Instance.GetItemDataByIdOrNull(itemId) == null) return null; diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/ItemUi/ItemViewModelFactory.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementUi.cs similarity index 99% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementUi.cs index 4fe2315b6..995054a89 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementUi.cs @@ -4,7 +4,7 @@ using UnityEngine.EventSystems; using UnityEngine.InputSystem; -namespace DDD +namespace DDD.Restaurant { [RequireComponent(typeof(RestaurantManagementViewModel))] public class RestaurantManagementUi : PopupUi diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementViewModel.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs similarity index 98% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementViewModel.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs index 2726902e9..3ada7d5d4 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementViewModel.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs @@ -4,7 +4,7 @@ using UnityEngine; using UnityEngine.Localization; -namespace DDD +namespace DDD.Restaurant { public class RestaurantManagementViewModel : SimpleViewModel, IEventHandler { @@ -55,7 +55,7 @@ public void CloseUi() OnCloseRequested?.Invoke(); } - public void Invoke(TodayMenuRemovedEvent evt) + public void HandleEvent(TodayMenuRemovedEvent evt) { SetCategory(evt.InventoryCategoryType); OnMenuCategorySelected?.Invoke(evt.InventoryCategoryType); @@ -252,7 +252,7 @@ public void CreateInventoryItemSlot(Transform parent) } else { - if (DataManager.Instance.GetDataSo().TryGetDataById(model.Id, out var cookwareData)) + if (DataManager.Instance.GetDataSo().TryGetDataById(model.Id, out var cookwareData)) { interactor.Initialize(TodayMenuEventType.Add, new TodayCookwareInteractorStrategy()); } @@ -334,18 +334,18 @@ private bool MatchesCategory(ItemModel model, InventoryCategoryType category) case InventoryCategoryType.Food: if (model.ItemType != ItemType.Recipe) return false; - return DataManager.Instance.GetDataSo() + return DataManager.Instance.GetDataSo() .TryGetDataById(model.Id, out var foodRecipe) && foodRecipe.RecipeType == RecipeType.FoodRecipe; case InventoryCategoryType.Drink: if (model.ItemType != ItemType.Recipe) return false; - return DataManager.Instance.GetDataSo() + return DataManager.Instance.GetDataSo() .TryGetDataById(model.Id, out var drinkRecipe) && drinkRecipe.RecipeType == RecipeType.DrinkRecipe; case InventoryCategoryType.Ingredient: return model.ItemType == ItemType.Ingredient; case InventoryCategoryType.Cookware: - return DataManager.Instance.GetDataSo() + return DataManager.Instance.GetDataSo() .TryGetDataById(model.Id, out var cookwareData); case InventoryCategoryType.Special: return false; @@ -431,7 +431,7 @@ private void RecomputeItemDetail() tasteMaterial: tasteMat); } - public IReadOnlyList GetTastes() => SelectedItem?.GetTasteDatas; + public IReadOnlyList GetTastes() => SelectedItem?.GetTasteDatas; public Material GetTasteMaterial() { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementViewModel.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/RestaurantManagementViewModel.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/ITabButton.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/ITabButton.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/ITabButton.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/ITabButton.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/ITabButton.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/ITabButton.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/ITabButton.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/ITabButton.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabButtonUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabButtonUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabButtonUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabButtonUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabButtonUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabButtonUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabButtonUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabButtonUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabGroupUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabGroupUi.cs similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabGroupUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabGroupUi.cs diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabGroupUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabGroupUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TabUi/TabGroupUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TabUi/TabGroupUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TasteHashTagSlotUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TasteHashTagSlotUi.cs similarity index 88% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TasteHashTagSlotUi.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TasteHashTagSlotUi.cs index 8d03b22d8..d17b48a71 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TasteHashTagSlotUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TasteHashTagSlotUi.cs @@ -22,7 +22,7 @@ private void OnDestroy() } } - public void Initialize(Material material, TasteData tasteData) + public void Initialize(Material material, TasteDataEntry tasteDataEntry) { if (_materialInstance != null) { @@ -31,6 +31,6 @@ public void Initialize(Material material, TasteData tasteData) _materialInstance = new Material(material); _backgroundImage.material = _materialInstance; - _localizeStringEvent.StringReference = LocalizationManager.Instance.GetLocalizedName(tasteData.Id); + _localizeStringEvent.StringReference = LocalizationManager.Instance.GetLocalizedName(tasteDataEntry.Id); } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TasteHashTagSlotUi.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TasteHashTagSlotUi.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TasteHashTagSlotUi.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TasteHashTagSlotUi.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs index a8357d228..8d505c36e 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs @@ -1,4 +1,4 @@ -namespace DDD +namespace DDD.Restaurant { public class TodayMenuInteractorStrategy : IItemSlotInteractorStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuInteractorStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs similarity index 98% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs index 12f02076d..8dbf7d252 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class TodayMenuSlotUiStrategy : IItemSlotUiStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs similarity index 89% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs index cdf650c90..127612052 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class TodayMenuView : MonoBehaviour, IUiView, IEventHandler, IEventHandler { @@ -31,12 +31,12 @@ public void OnClosedEvents() EventBus.Unregister(this); } - public void Invoke(TodayMenuAddedEvent evt) + public void HandleEvent(TodayMenuAddedEvent evt) { UpdateView(); } - public void Invoke(TodayMenuRemovedEvent evt) + public void HandleEvent(TodayMenuRemovedEvent evt) { UpdateView(); } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayMenuUi/TodayMenuView.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs index 7e8fba35d..5b472b150 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs @@ -1,4 +1,4 @@ -namespace DDD +namespace DDD.Restaurant { public class TodayCookwareInteractorStrategy : IItemSlotInteractorStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareInteractorStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs index 1872ecc68..d3d768572 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class TodayCookwareSlotUiStrategy : IItemSlotUiStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs similarity index 90% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs index 73d37cbf6..26716fbb8 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class TodayRestaurantStateView : MonoBehaviour, IUiView, IEventHandler, IEventHandler { @@ -32,12 +32,12 @@ public void OnClosedEvents() EventBus.Unregister(this); } - public void Invoke(TodayMenuAddedEvent evt) + public void HandleEvent(TodayMenuAddedEvent evt) { UpdateView(); } - public void Invoke(TodayMenuRemovedEvent evt) + public void HandleEvent(TodayMenuRemovedEvent evt) { UpdateView(); } diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayRestaurantStateView.cs.meta diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs similarity index 97% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs index 2252a36ac..5f3b4e116 100644 --- a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DDD +namespace DDD.Restaurant { public class TodayWorkerSlotUiStrategy : IItemSlotUiStrategy { diff --git a/Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs.meta b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs.meta similarity index 100% rename from Assets/_DDD/_Scripts/GameUi/BaseUi/PopupUis/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs.meta rename to Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/TodayRestaurantStateUi/TodayWorkerSlotUiStrategy.cs.meta diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/MoveToInteractionTarget.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/MoveToInteractionTarget.cs deleted file mode 100644 index 828782504..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Common/Actions/MoveToInteractionTarget.cs +++ /dev/null @@ -1,173 +0,0 @@ -using Opsive.BehaviorDesigner.Runtime.Tasks; -using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; -using UnityEngine; - -namespace DDD -{ - /// - /// IAiMovement를 이용해 인터랙션 타겟으로 이동하는 액션 - /// - public class MoveToInteractionTarget : Action - { - [Header("Target Settings")] - [Tooltip("InteractionPoints를 사용해 가장 가까운 지점으로 이동")] - [SerializeField] private bool useInteractionPoints = true; - [Tooltip("타겟이 없을 때 즉시 실패할지 여부")] - [SerializeField] private bool failIfNoTarget = true; - - [Header("Movement Settings")] - [Tooltip("목적지 도달 거리")] - [SerializeField] private float stoppingDistance = 0.01f; - [Tooltip("목적지 재계산 주기(초), 0 이하면 비활성화")] - [SerializeField] private float repathInterval = 0.5f; - - private IAiMovement movement; - private float repathTimer; - private Vector3 currentDestination; - private bool isMoving; - private GameObject cachedTarget; - - public override void OnStart() - { - if (cachedTarget != null) return; - movement = gameObject.GetComponentInParent(); - repathTimer = 0f; - isMoving = false; - cachedTarget = null; - } - - public override TaskStatus OnUpdate() - { - if (movement == null) - return TaskStatus.Failure; - - var target = GetTarget(); - if (target == null) - return failIfNoTarget ? TaskStatus.Failure : TaskStatus.Success; - Debug.Log(target.name); - - if (ShouldUpdateDestination()) - { - currentDestination = CalculateDestination(target); - StartOrUpdateMovement(); - } - - return CheckMovementCompletion(); - } - - public override void OnEnd() - { - StopMovement(); - cachedTarget = null; - } - - private GameObject GetTarget() - { - // 캐시된 타겟이 유효하면 재사용 - if (IsValidTarget(cachedTarget)) - return cachedTarget; - - // 블랙보드에서 타겟 검색 - cachedTarget = gameObject.GetComponentInParent() - ?.GetCurrentInteractionTarget(); - - if (IsValidTarget(cachedTarget)) - return cachedTarget; - - // Interactor의 포커스된 타겟 검색 - var interactor = gameObject.GetComponentInParent(); - var focusedInteractable = interactor?.GetFocusedInteractable(); - cachedTarget = focusedInteractable?.GetInteractableGameObject(); - - return cachedTarget; - } - - private bool IsValidTarget(GameObject target) => - target != null && target; - - private bool ShouldUpdateDestination() - { - repathTimer -= Time.deltaTime; - return !isMoving || (repathInterval > 0f && repathTimer <= 0f); - } - - private Vector3 CalculateDestination(GameObject target) - { - repathTimer = repathInterval; - - if (!useInteractionPoints) - return target.transform.position; - - return target.TryGetComponent(out var ric) - ? GetNearestInteractionPoint(ric) - : target.transform.position; - } - - private Vector3 GetNearestInteractionPoint(RestaurantInteractionComponent ric) - { - var points = ric.GetInteractionPoints(); - if (points == null || points.Length == 0) - return ric.transform.position; - - var agentPosition = GetAgentPosition(); - var nearestPoint = ric.transform.position; - var minDistanceSqr = float.MaxValue; - - foreach (var point in points) - { - var distanceSqr = (point - agentPosition).sqrMagnitude; - if (distanceSqr < minDistanceSqr) - { - minDistanceSqr = distanceSqr; - nearestPoint = point; - } - } - - return nearestPoint; - } - - private void StartOrUpdateMovement() - { - if (!isMoving) - { - if (movement.TryMoveToPosition(currentDestination)) - { - movement.EnableMove(); - movement.PlayMove(); - isMoving = true; - } - } - else - { - movement.TryMoveToPosition(currentDestination); - } - } - - private TaskStatus CheckMovementCompletion() - { - var distanceSqr = (GetAgentPosition() - currentDestination).sqrMagnitude; - var stoppingDistanceSqr = stoppingDistance * stoppingDistance; - - if (distanceSqr <= stoppingDistanceSqr || movement.HasReachedDestination()) - { - StopMovement(); - return TaskStatus.Success; - } - - return TaskStatus.Running; - } - - private void StopMovement() - { - if (movement != null && isMoving) - { - movement.StopMove(); - movement.DisableMove(); - isMoving = false; - } - } - - private Vector3 GetAgentPosition() => - movement?.CurrentPosition ?? transform.position; - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/WaitForPlayerInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/WaitForPlayerInteraction.cs deleted file mode 100644 index 220788be6..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/Actions/WaitForPlayerInteraction.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Opsive.BehaviorDesigner.Runtime.Tasks; -using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; -using UnityEngine; - -namespace DDD -{ - //범용적으로 사용할 수 있을 것 같음 - //차후 제네릭으로 변경 가능성 있음 - public class WaitForPlayerInteraction : Action - { - [Tooltip("기다릴 상호작용 타입")] - [SerializeField] private RestaurantMealType _targetOrderType = RestaurantMealType.WaitForOrder; - - private IInteractionSubsystemObject _interactionSubsystem; - private bool _isGetInteractionSubsystem; - - public override void OnStart() - { - // 의자가 복합 상태를 가지게 될 경우 - // GameObject interactionTarget = null; - // var shared = gameObject.GetComponentInChildren(); - // if (shared != null) - // { - // interactionTarget = shared.GetCurrentInteractionTarget(); - // } - // else - // { - // // 하위 호환: 고객 전용 블랙보드 지원 - // var customerBb = gameObject.GetComponentInParent(); - // interactionTarget = customerBb?.GetCurrentInteractionTarget(); - // } - // - // if (interactionTarget == null) - // { - // Debug.LogError($"[{GetType().Name}] interactionTarget을 찾을 수 없습니다: {gameObject.name}"); - // return; - // } - // - // if (!interactionTarget.TryGetComponent(out var interactionComponent)) - // Debug.LogError($"[{interactionTarget.name}] {nameof(interactionComponent)}를 찾을 수 없습니다: {gameObject.name}"); - // if (interactionComponent is IInteractionSubsystemOwner subsystemOwner) - // { - // if (!subsystemOwner.TryGetSubsystemObject(out var subsystem)) - // { - // Debug.LogError($"[{GetType().Name}] {nameof(_targetOrderType)}의 Subsystem을 찾을 수 없습니다: {gameObject.name}"); - // _isGetInteractionSubsystem = false; - // return; - // } - // - // _isGetInteractionSubsystem = true; - // subsystem.SetInteractionSubsystemType(_targetOrderType); - // - // if (!gameObject.TryGetComponent(out var interactor)) - // { - // Debug.LogError($"[{GetType().Name}] IInteractor를 찾을 수 없습니다: {gameObject.name}"); - // return; - // } - // - // interactor.CanInteractTo(interactionComponent); - // - // _interactionSubsystem = subsystem; - // } - - if (!gameObject.TryGetComponent(out var interactionComponent)) - { - Debug.LogError($"[{GetType().Name}]에서 interactionComponent를 찾을 수 없습니다: {gameObject.name}"); - return; - } - - if (interactionComponent is not IInteractionSubsystemOwner subsystemOwner) - { - Debug.LogError($"[{GetType().Name}]에서 {nameof(IInteractionSubsystemOwner)}를 찾을 수 없습니다: {gameObject.name}"); - return; - } - - if (!subsystemOwner.TryGetSubsystemObject(out _interactionSubsystem)) - { - Debug.LogError($"[{GetType().Name}]에서 {nameof(IInteractionSubsystemObject)}를 찾을 수 없습니다: {gameObject.name}"); - return; - } - - _interactionSubsystem.SetInteractionSubsystemType(_targetOrderType); - _isGetInteractionSubsystem = true; - } - - public override TaskStatus OnUpdate() - { - if (!_isGetInteractionSubsystem) return TaskStatus.Failure; - - TaskStatus result = CheckToSubsystemStatus(); - if (result == TaskStatus.Success) Debug.Log($"[{GetType().Name}] Success"); - return result; - } - - private TaskStatus CheckToSubsystemStatus() - { - return _interactionSubsystem.GetInteractionSubsystemType() == _targetOrderType - ? TaskStatus.Running - : TaskStatus.Success; - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerBlackboardComponent.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerBlackboardComponent.cs deleted file mode 100644 index 98112000e..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/AI/Customer/RestaurantCustomerBlackboardComponent.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Opsive.BehaviorDesigner.Runtime; -using UnityEngine; - -namespace DDD -{ - public class RestaurantCustomerBlackboardComponent : MonoBehaviour, IRestaurantCustomerBlackboard, IAISharedBlackboard - { - private Subtree _subtree; - private GameObject _currentInteractionTarget; - - public void InitializeWithBehaviorTree(Subtree subtree) - { - _subtree = subtree; - if (_subtree != null) - { - _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.SelfGameObject), gameObject); - } - } - - public void SetCustomerData(CustomerData inCustomerData) - { - if (_subtree == null) return; - _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData); - } - - public void SetCurrentInteractionTarget(GameObject targetGameObject) - { - _currentInteractionTarget = targetGameObject; - if (_subtree == null) return; - _subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CurrentInteractionTarget), targetGameObject); - } - - public GameObject GetCurrentInteractionTarget() - { - // 캐시 우선 반환. 필요 시 Subtree에서 직접 조회하도록 확장 가능. - return _currentInteractionTarget; - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovementConstraint.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovementConstraint.cs deleted file mode 100644 index ad63b91a3..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Core/RestaurantCharacterMovementConstraint.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; - -namespace DDD -{ - [RequireComponent(typeof(RestaurantCharacterAnimation))] - public class RestaurantCharacterMovementConstraint : MonoBehaviour, IRestaurantMovementConstraint - { - public bool IsBlockingMovement() - { - if (GetComponent().IsPlayingAnimation()) - { - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerAi.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerAi.cs deleted file mode 100644 index 785b8bb03..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerAi.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace DDD -{ - public interface IRestaurantCustomerAi - { - void InitializeAi(CustomerData inCustomerData); - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerBlackboard.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerBlackboard.cs deleted file mode 100644 index 51859cddf..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Interfaces/IRestaurantCustomerBlackboard.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; - -namespace DDD -{ - public enum RestaurantCustomerBlackboardKey - { - SelfGameObject, - CustomerData, - CurrentInteractionTarget, - } - - public interface IRestaurantCustomerBlackboard - { - void SetCustomerData(CustomerData inCustomerData); - void SetCurrentInteractionTarget(GameObject targetGameObject); - GameObject GetCurrentInteractionTarget(); - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs deleted file mode 100644 index bba008853..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Npc/Customer/CustomerCharacter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Threading.Tasks; -using Opsive.BehaviorDesigner.Runtime; -using UnityEngine; -using UnityEngine.AddressableAssets; - -namespace DDD -{ - [RequireComponent(typeof(RestaurantCustomerAiComponent))] - public class CustomerCharacter : RestaurantNpcCharacter, ICustomerInitializer - { - private CustomerData _customerData; - protected IRestaurantCustomerAi restaurantCustomerAi; - - protected override void Awake() - { - base.Awake(); - restaurantCustomerAi = GetComponent(); - } - - public void Initialize(CustomerData customerData) - { - _customerData = customerData; - restaurantCustomerAi.InitializeAi(_customerData); - - // 스킨 설정 - _spineController.SetSkin(_customerData.SpineSkinKey); - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs b/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs deleted file mode 100644 index a86e19447..000000000 --- a/Assets/_DDD/_Scripts/RestaurantCharacter/Player/RestaurantPlayerInteraction.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.Threading.Tasks; -using UnityEngine; -using UnityEngine.InputSystem; - -namespace DDD -{ - public class RestaurantPlayerInteraction : RestaurantCharacterInteraction - { - private RestaurantPlayerData _restaurantPlayerDataSo; - - protected override void Start() - { - base.Start(); - - _ = Initialize(); - } - - private Task Initialize() - { - _restaurantPlayerDataSo = RestaurantData.Instance.PlayerData; - Debug.Assert(_restaurantPlayerDataSo != null, "_restaurantPlayerDataSo is null"); - - _restaurantPlayerDataSo!.InteractAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Interact)); - _restaurantPlayerDataSo.InteractAction.performed += OnInteractPerformed; - _restaurantPlayerDataSo.InteractAction.canceled += OnInteractCanceled; - - _interactionRadius = _restaurantPlayerDataSo.InteractionRadius; - _interactionLayerMask = _restaurantPlayerDataSo.InteractionLayerMask; - - EventBus.Register(this); - - return Task.CompletedTask; - } - - protected override void OnDestroy() - { - base.OnDestroy(); - - if (_restaurantPlayerDataSo != null) - { - _restaurantPlayerDataSo.InteractAction.performed -= OnInteractPerformed; - _restaurantPlayerDataSo.InteractAction.canceled -= OnInteractCanceled; - } - - EventBus.Unregister(this); - } - - private void OnInteractPerformed(InputAction.CallbackContext context) - { - if (_nearestInteractable == null || CanInteractTo(_nearestInteractable) == false) return; - - float requiredHoldTime = _nearestInteractable.GetExecutionParameters().HoldTime; - - if (requiredHoldTime <= 0f) - { - _nearestInteractable.OnInteracted(this); - } - else - { - _isInteracting = true; - _interactHeldTime = 0f; - _interactingTarget = _nearestInteractable; - } - } - - private void OnInteractCanceled(InputAction.CallbackContext context) - { - OnInteractionHoldProgress(0f); - ResetInteractionState(); - } - - protected override void OnNearestInteractableChanged(IInteractable newTarget) - { - if (newTarget != null) - { - BroadcastShowUi(newTarget, CanInteractTo(newTarget), 0f); - } - else - { - EventBus.Broadcast(GameEvents.HideInteractionUiEvent); - } - } - - protected override void OnInteractionHoldProgress(float ratio) - { - if (_interactingTarget != null) - { - BroadcastShowUi(_interactingTarget, CanInteractTo(_interactingTarget), ratio); - } - } - - protected override void OnInteractionCompleted() - { - - } - - private void BroadcastShowUi(IInteractable interactable, bool canInteract, float ratio) - { - var evt = GameEvents.ShowInteractionUiEvent; - evt.CanInteract = canInteract; - evt.TextKey = interactable.GetDisplayParameters().MessageKey; - evt.HoldProgress = ratio; - EventBus.Broadcast(evt); - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantData/RestaurantData.cs b/Assets/_DDD/_Scripts/RestaurantData/RestaurantData.cs deleted file mode 100644 index 2c484bdb8..000000000 --- a/Assets/_DDD/_Scripts/RestaurantData/RestaurantData.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Threading.Tasks; -using UnityEngine; -using UnityEngine.AddressableAssets; - -namespace DDD -{ - [CreateAssetMenu(fileName = "RestaurantData", menuName = "RestaurantData/RestaurantData", order = 0)] - public class RestaurantData : ScriptSingleton - { - [SerializeField] private AssetReference _restaurantPlayerData; - [SerializeField] private AssetReference _restaurantManagementData; - [SerializeField] private AssetReference _restaurantRunData; - [SerializeField] private AssetReference _restaurantCustomerData; - - public RestaurantPlayerData PlayerData { get; private set; } - public RestaurantManagementData ManagementData { get; private set; } - public RestaurantRunData RunData { get; private set; } - public RestaurantCustomerData CustomerData { get; private set; } - - private bool _isLoaded; - - public async Task LoadData() - { - if (_isLoaded) - { - return; - } - - var restaurantPlayerDataHandle = _restaurantPlayerData.LoadAssetAsync(); - var restaurantManagementDataHandle = _restaurantManagementData.LoadAssetAsync(); - var restaurantRunDataHandle = _restaurantRunData.LoadAssetAsync(); - var restaurantCustomerDataHandle = _restaurantCustomerData.LoadAssetAsync(); - - await Task.WhenAll( - restaurantPlayerDataHandle.Task, - restaurantManagementDataHandle.Task, - restaurantRunDataHandle.Task, - restaurantCustomerDataHandle.Task - ); - - PlayerData = restaurantPlayerDataHandle.Result; - ManagementData = restaurantManagementDataHandle.Result; - RunData = restaurantRunDataHandle.Result; - CustomerData = restaurantCustomerDataHandle.Result; - - Debug.Assert(PlayerData != null, "RestaurantPlayerData is null"); - Debug.Assert(ManagementData != null, "RestaurantManagementData is null"); - Debug.Assert(RunData != null, "RestaurantRunData is null"); - Debug.Assert(CustomerData != null, "RestaurantCustomerData is null"); - - _isLoaded = true; - } - - private void OnDisable() - { - if (_isLoaded == false) return; - - _restaurantPlayerData.ReleaseAsset(); - _restaurantManagementData.ReleaseAsset(); - _restaurantRunData.ReleaseAsset(); - _restaurantCustomerData.ReleaseAsset(); - - _isLoaded = false; - } - } -} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Utilities/Constants.cs b/Assets/_DDD/_Scripts/Utilities/Constants.cs index 7f438dcd7..8bc7ccd7a 100644 --- a/Assets/_DDD/_Scripts/Utilities/Constants.cs +++ b/Assets/_DDD/_Scripts/Utilities/Constants.cs @@ -14,16 +14,16 @@ public static class DataConstants { public const string GameStateSo = "GameStateSo"; public const string InventoryTestDataSo = "InventoryTestDataSo"; - public const string ItemDataSo = "ItemDataSo"; - public const string RecipeDataSo = "RecipeDataSo"; - public const string FoodDataSo = "FoodDataSo"; - public const string DrinkDataSo = "DrinkDataSo"; - public const string IngredientDataSo = "IngredientDataSo"; - public const string CookwareDataSo = "CookwareDataSo"; - public const string TasteDataSo = "TasteDataSo"; - public const string EnvironmentDataSo = "EnvironmentDataSo"; - public const string LevelDataSo = "LevelDataSo"; - public const string CustomerPoolDataSo = "CustomerPoolDataSo"; + public const string ItemDataSo = "ItemDataAsset"; + public const string RecipeDataSo = "RecipeDataAsset"; + public const string FoodDataSo = "FoodDataAsset"; + public const string DrinkDataSo = "DrinkDataAsset"; + public const string IngredientDataSo = "IngredientDataAsset"; + public const string CookwareDataSo = "CookwareDataAsset"; + public const string TasteDataSo = "TasteDataAsset"; + public const string EnvironmentDataSo = "EnvironmentDataAsset"; + public const string LevelDataSo = "LevelDataAsset"; + public const string CustomerPoolDataSo = "CustomerPoolDataAsset"; public const string UiInputBindingSo = "UiInputBindingSo"; public const string RestaurantDataSo = "RestaurantDataSo"; diff --git a/Assets/_DDD/_Scripts/Utilities/ScriptSingleton.cs b/Assets/_DDD/_Scripts/Utilities/ScriptSingleton.cs index 9cffb682e..4aff59fcd 100644 --- a/Assets/_DDD/_Scripts/Utilities/ScriptSingleton.cs +++ b/Assets/_DDD/_Scripts/Utilities/ScriptSingleton.cs @@ -39,21 +39,16 @@ public static T Instance lock (_lock) { - // 이중 체크 락킹 패턴 if (_instance != null) return _instance; try { var key = ResolveAddressKey(); - var handle = Addressables.LoadAssetAsync(key); - - // 동기 로드: 메인 스레드에서 호출할 것을 권장합니다. - var loaded = handle.WaitForCompletion(); - - if (handle.Status != AsyncOperationStatus.Succeeded || loaded == null) + var loaded = AssetManager.Instance.LoadAsset(key); + if (loaded == null) { - throw new InvalidOperationException($"Addressables 로드 실패: 타입='{typeof(T).Name}', key='{key}'"); + throw new InvalidOperationException($"AssetManager를 통한 로드 실패: 타입='{typeof(T).Name}', key='{key}'"); } _instance = loaded; @@ -62,9 +57,9 @@ public static T Instance return _instance; } - catch (Exception) + catch (Exception e) { - throw; + throw new Exception(e.Message, e); } } }