Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
lsm 2025-08-19 12:30:05 +09:00
commit 850ff5a1f3
96 changed files with 409 additions and 322 deletions

Binary file not shown.

View File

@ -338,6 +338,7 @@ PrefabInstance:
- {fileID: 3365694194251356714, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - {fileID: 3365694194251356714, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
- {fileID: 127430239903465757, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - {fileID: 127430239903465757, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
- {fileID: 7606279200344222219, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - {fileID: 7606279200344222219, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
- {fileID: 3095965496140440094, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 4993183601549197863, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - targetCorrespondingSourceObject: {fileID: 4993183601549197863, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
@ -359,6 +360,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 388082324973004231} addedObject: {fileID: 388082324973004231}
- targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
insertIndex: -1
addedObject: {fileID: 152577516172191389}
- targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3} - targetCorrespondingSourceObject: {fileID: 5259510642736920361, guid: 3db3fc62639929c4ba6031ca4ae6600c, type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 8993310060139522557} addedObject: {fileID: 8993310060139522557}
@ -431,6 +435,18 @@ MonoBehaviour:
- {fileID: 0} - {fileID: 0}
- {fileID: 0} - {fileID: 0}
- {fileID: 0} - {fileID: 0}
--- !u!114 &152577516172191389
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7316134055819320434}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6ea5b6b4333d6fa4392d4d0a09d97242, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &8993310060139522557 --- !u!114 &8993310060139522557
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: afe0250614f8af643a95058970e9f647
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/_DDD/_Addressables/So/GameData/GameData.asset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 094ff53715c99c54ea7e6702a6933228 guid: acb945af9ef1953408e259003ddee155
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000 mainObjectFileID: 11400000

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 899d2f22a3c355740897ec6bdf2fb6d1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

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

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9fac99a2d5b6eb240a64b9e010a22ac4 guid: 1263bd88e8e68a94b853d23b321ed172
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000 mainObjectFileID: 11400000

Binary file not shown.

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -45,3 +45,15 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_persistent: 1 _persistent: 1
_gameData:
m_AssetGUID: e12b1e83b4adb034fb3525c202663954
m_SubObjectName:
m_SubObjectType:
m_SubObjectGUID:
m_EditorAssetChanged: 1
_gameState:
m_AssetGUID: 57f96cac976cace4b8107ab44edb0f71
m_SubObjectName:
m_SubObjectType:
m_SubObjectGUID:
m_EditorAssetChanged: 1

View File

@ -45,3 +45,15 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_persistent: 1 _persistent: 1
_restaurantData:
m_AssetGUID: 2d86890c5ef774c4aae6870f0eeef0f5
m_SubObjectName:
m_SubObjectType:
m_SubObjectGUID:
m_EditorAssetChanged: 1
_restaurantState:
m_AssetGUID: 9cd28a9cdddf5dd4e9c729431a345509
m_SubObjectName:
m_SubObjectType:
m_SubObjectGUID:
m_EditorAssetChanged: 1

Binary file not shown.

View File

@ -2,27 +2,30 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.AddressableAssets;
namespace DDD namespace DDD
{ {
public class GameController : Singleton<GameController>, IManager, IGameFlowHandler public class GameController : Singleton<GameController>, IManager, IGameFlowHandler
{ {
private static readonly List<Type> GameFlowControllerTypes = new(); [SerializeField] private AssetReference _gameData;
public GameDataSo GetGameData() => GameDataSo.instance; public GameData GameData { get; private set; }
public GameStateSo GetGameState() => GameStateSo.instance; public GameState GameState { get; private set; }
private List<FlowController> _gameFlowControllers = new(); private List<FlowController> _gameFlowControllers = new();
private static readonly List<Type> GameFlowControllerTypes = new();
public void PreInit() public void PreInit()
{ {
LoadOrCreateRestaurantState();
RegisterFlowHandler(); RegisterFlowHandler();
} }
public async Task Init() public async Task Init()
{ {
await LoadData(); await LoadData();
await GameDataSo.instance.LoadData(); await GameData.LoadData();
await InitializeAllFlowControllers(); await InitializeAllFlowControllers();
} }
@ -30,6 +33,12 @@ public void PostInit()
{ {
} }
private void LoadOrCreateRestaurantState()
{
// TODO : Load states from saved files. if none, create them.
GameState = ScriptableObject.CreateInstance<GameState>();
}
private void RegisterFlowHandler() private void RegisterFlowHandler()
{ {
GameFlowManager.Instance.FlowHandlers.Add(this); GameFlowManager.Instance.FlowHandlers.Add(this);
@ -53,9 +62,17 @@ private async Task InitializeAllFlowControllers()
} }
} }
private Task LoadData() private async Task LoadData()
{ {
return Task.CompletedTask; var gameDataHandle = _gameData.LoadAssetAsync<GameData>();
await gameDataHandle.Task;
GameData = gameDataHandle.Result;
Debug.Assert(GameData != null, "GameData is null");
await Task.CompletedTask;
} }
public async Task OnReadyNewFlow(GameFlowState newFlowState) public async Task OnReadyNewFlow(GameFlowState newFlowState)

View File

@ -0,0 +1,40 @@
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;
namespace DDD
{
[CreateAssetMenu(fileName = "GameData", menuName = "GameData/GameData")]
public class GameData : ScriptableObject
{
[SerializeField] private AssetReference _gameLocalizationData;
public GameLocalizationData LocalizationData { get; private set; }
private bool _isLoaded;
public async Task LoadData()
{
if (_isLoaded)
{
return;
}
var gameLocalizationDataHandle = _gameLocalizationData.LoadAssetAsync<GameLocalizationData>();
await gameLocalizationDataHandle.Task;
LocalizationData = gameLocalizationDataHandle.Result;
Debug.Assert(LocalizationData != null, "GameLocalizationData is null");
_isLoaded = true;
}
private void OnDisable()
{
if (_isLoaded == false) return;
_gameLocalizationData.ReleaseAsset();
_isLoaded = false;
}
}
}

View File

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

View File

@ -1,47 +0,0 @@
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Localization.SmartFormat.PersistentVariables;
using UnityEngine.ResourceManagement.AsyncOperations;
namespace DDD
{
[CreateAssetMenu(fileName = "GameDataSo", menuName = "GameData/GameDataSo", order = 0)]
public class GameDataSo : ScriptableSingleton<GameDataSo>
{
[Header("Asset References")]
[SerializeField] private AssetReference _gameLocalizationDataSo;
public GameLocalizationDataSo GameLocalizationData { get; private set; }
private bool _isLoaded;
public async Task LoadData()
{
if (_isLoaded)
{
return;
}
var smartStringHandle = _gameLocalizationDataSo.LoadAssetAsync<GameLocalizationDataSo>();
await smartStringHandle.Task;
GameLocalizationData = smartStringHandle.Result;
Debug.Assert(GameLocalizationData != null, "SmartStringVariableGroup is null");
_isLoaded = true;
}
private void OnDisable()
{
if (!_isLoaded) return;
_gameLocalizationDataSo.ReleaseAsset();
_isLoaded = false;
}
}
}

View File

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

View File

@ -3,8 +3,8 @@
namespace DDD namespace DDD
{ {
[CreateAssetMenu(fileName = "GameLocalizationDataSo", menuName = "GameData/GameLocalizationDataSo")] [CreateAssetMenu(fileName = "GameLocalizationData", menuName = "GameData/GameLocalizationData")]
public class GameLocalizationDataSo : ScriptableObject public class GameLocalizationData : ScriptableObject
{ {
public VariablesGroupAsset SmartStringVariableGroup; public VariablesGroupAsset SmartStringVariableGroup;
} }

View File

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

View File

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

View File

@ -97,7 +97,7 @@ public string GetString(string key)
var entryRef = key; var entryRef = key;
var locale = LocalizationSettings.SelectedLocale; var locale = LocalizationSettings.SelectedLocale;
VariablesGroupAsset variables = GameDataSo.instance.GameLocalizationData.SmartStringVariableGroup; VariablesGroupAsset variables = GameController.Instance.GameData.LocalizationData.SmartStringVariableGroup;
if (variables != null) if (variables != null)
{ {
_singleArgBuffer.Clear(); _singleArgBuffer.Clear();

View File

@ -50,8 +50,8 @@ public void PreInit() { }
public async Task Init() public async Task Init()
{ {
var gameLevelStateSo = GameStateSo.instance.GameLevelStateSo; var gameLevelStateSo = GameController.Instance.GameState.LevelState;
var restaurantStateSo = RestaurantState.instance.ManagementState; var restaurantStateSo = RestaurantController.Instance.RestaurantState.ManagementState;
// 예시: day 초기 세팅 (없으면 생성, 타입 다르면 교체) // 예시: day 초기 세팅 (없으면 생성, 타입 다르면 교체)
Set(_smartStringKeys[smartStringKey.Day], gameLevelStateSo.Level); Set(_smartStringKeys[smartStringKey.Day], gameLevelStateSo.Level);
@ -71,7 +71,7 @@ public void PostInit()
EventBus.Register<SmartVariablesDirtyEvent>(this); EventBus.Register<SmartVariablesDirtyEvent>(this);
} }
private RestaurantManagementStateSo GetRestaurantState() => RestaurantState.instance.ManagementState; private RestaurantManagementState GetRestaurantState() => RestaurantController.Instance.RestaurantState.ManagementState;
public void Invoke(SmartVariablesDirtyEvent evt) public void Invoke(SmartVariablesDirtyEvent evt)
{ {
@ -113,7 +113,7 @@ public void RefreshChecklistTargets()
public void RefreshDay() public void RefreshDay()
{ {
var gameLevelStateSo = GameStateSo.instance.GameLevelStateSo; var gameLevelStateSo = GameController.Instance.GameState.LevelState;
Set(_smartStringKeys[smartStringKey.Day], gameLevelStateSo.Level); Set(_smartStringKeys[smartStringKey.Day], gameLevelStateSo.Level);
} }
@ -179,7 +179,7 @@ public void SetEnum<TEnum>(string key, TEnum value) where TEnum : struct
return null; return null;
} }
var smartStringVariableGroup = GameDataSo.instance.GameLocalizationData.SmartStringVariableGroup; var smartStringVariableGroup = GameController.Instance.GameData.LocalizationData.SmartStringVariableGroup;
if (smartStringVariableGroup.TryGetValue(key, out var existing)) if (smartStringVariableGroup.TryGetValue(key, out var existing))
{ {

View File

@ -2,7 +2,7 @@
namespace DDD namespace DDD
{ {
public class GameLevelStateSo : ScriptableObject public class GameLevelState : ScriptableObject
{ {
public int Level = 1; public int Level = 1;

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 39c94e10e2c3ed94db2c04949059499e

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 8b38b5ba62c327b48a2a8f60869bf45a

View File

@ -0,0 +1,17 @@
using UnityEngine;
using UnityEngine.AddressableAssets;
namespace DDD
{
public class GameState : ScriptableObject
{
[SerializeField] private AssetReference _gameLevelState;
public GameLevelState LevelState { get; private set; }
private void OnEnable()
{
LevelState = CreateInstance<GameLevelState>();
}
}
}

View File

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

View File

@ -1,17 +0,0 @@
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
namespace DDD
{
[CreateAssetMenu(fileName = "GameStateSo", menuName = "GameState/GameStateSo")]
public class GameStateSo : ScriptableSingleton<GameStateSo>
{
public GameLevelStateSo GameLevelStateSo { get; private set; }
private void OnEnable()
{
GameLevelStateSo = CreateInstance<GameLevelStateSo>();
}
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 9b8aa6c32ff3e8b49bc8365e3a6e2218

View File

@ -25,11 +25,11 @@ public class ChecklistView : MonoBehaviour, IEventHandler<TodayMenuAddedEvent>,
{ChecklistLocalizationKey.Checklist3, "checklist_3"}, {ChecklistLocalizationKey.Checklist3, "checklist_3"},
}; };
private RestaurantManagementStateSo restaurantManagementStateSo; private RestaurantManagementState restaurantManagementStateSo;
public void Initalize() public void Initalize()
{ {
restaurantManagementStateSo = RestaurantState.instance.ManagementState; restaurantManagementStateSo = RestaurantController.Instance.RestaurantState.ManagementState;
_checklistDatas = new List<ChecklistData>(3); _checklistDatas = new List<ChecklistData>(3);
_checklistDatas = GetComponentsInChildren<ChecklistData>().ToList(); _checklistDatas = GetComponentsInChildren<ChecklistData>().ToList();

View File

@ -40,7 +40,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
public RuntimeAnimatorController GetAnimatorController() public RuntimeAnimatorController GetAnimatorController()
{ {
return RestaurantDataSo.instance.ManagementData.InventorySlotUiAnimatorController; return RestaurantController.Instance.RestaurantData.ManagementData.InventorySlotUiAnimatorController;
} }
public void OnInventoryChanged(ItemSlotUi ui) public void OnInventoryChanged(ItemSlotUi ui)

View File

@ -10,8 +10,8 @@ public class InventoryView : MonoBehaviour, IEventHandler<InventoryChangedEvent>
{ {
[SerializeField] private Transform _slotParent; [SerializeField] private Transform _slotParent;
private RestaurantManagementDataSo restaurantManagementDataSo; private RestaurantManagementData restaurantManagementDataSo;
private RestaurantManagementStateSo restaurantManagementStateSo; private RestaurantManagementState restaurantManagementStateSo;
private InventoryCategoryType _currenInventoryCategoryType = InventoryCategoryType.Food; private InventoryCategoryType _currenInventoryCategoryType = InventoryCategoryType.Food;
private readonly Dictionary<string, ItemSlotUi> _slotLookup = new(); private readonly Dictionary<string, ItemSlotUi> _slotLookup = new();
@ -38,8 +38,8 @@ private void OnDisable()
public void Initialize() public void Initialize()
{ {
restaurantManagementStateSo = RestaurantState.instance.ManagementState; restaurantManagementStateSo = RestaurantController.Instance.RestaurantState.ManagementState;
restaurantManagementDataSo = RestaurantDataSo.instance.ManagementData; restaurantManagementDataSo = RestaurantController.Instance.RestaurantData.ManagementData;
Debug.Assert(restaurantManagementDataSo != null, "_todayMenuDataSo != null"); Debug.Assert(restaurantManagementDataSo != null, "_todayMenuDataSo != null");
Clear(); Clear();

View File

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.Localization.Components; using UnityEngine.Localization.Components;
@ -22,7 +21,7 @@ public class ItemDetailView : MonoBehaviour, IEventHandler<ItemSlotSelectedEvent
[SerializeField] private HorizontalLayoutGroup _tasteHashTagContentLayoutGroup; [SerializeField] private HorizontalLayoutGroup _tasteHashTagContentLayoutGroup;
[SerializeField] private RectTransform _tasteHashTagContent2; [SerializeField] private RectTransform _tasteHashTagContent2;
private RestaurantManagementDataSo restaurantManagementDataSo; private RestaurantManagementData restaurantManagementDataSo;
private List<TasteHashTagSlotUi> _tasteHashTagSlotUis = new(); private List<TasteHashTagSlotUi> _tasteHashTagSlotUis = new();
private ItemViewModel _currentItemViewModel; private ItemViewModel _currentItemViewModel;
@ -40,11 +39,6 @@ private void Start()
private void OnEnable() private void OnEnable()
{ {
if (restaurantManagementDataSo == null)
{
restaurantManagementDataSo = RestaurantDataSo.instance.ManagementData;
}
EventBus.Register<ItemSlotSelectedEvent>(this); EventBus.Register<ItemSlotSelectedEvent>(this);
} }
@ -53,6 +47,11 @@ private void OnDisable()
EventBus.Unregister<ItemSlotSelectedEvent>(this); EventBus.Unregister<ItemSlotSelectedEvent>(this);
} }
public void Initialize()
{
restaurantManagementDataSo = RestaurantController.Instance.RestaurantData.ManagementData;
}
public void Invoke(ItemSlotSelectedEvent evt) public void Invoke(ItemSlotSelectedEvent evt)
{ {
Show(evt.Model); Show(evt.Model);

View File

@ -60,7 +60,7 @@ private void UpdateHoldProgress()
private void ProcessCompleteBatchAction() private void ProcessCompleteBatchAction()
{ {
if (RestaurantState.instance.ManagementState.GetChecklistStates().Any(state => state == false)) if (RestaurantController.Instance.RestaurantState.ManagementState.GetChecklistStates().Any(state => state == false))
{ {
ShowChecklistFailedPopup(); ShowChecklistFailedPopup();
} }
@ -115,6 +115,7 @@ private void InitializeViews()
{ {
_checklistView.Initalize(); _checklistView.Initalize();
_inventoryView.Initialize(); _inventoryView.Initialize();
_itemDetailView.Initialize();
_todayMenuView.Initialize(); _todayMenuView.Initialize();
_todayRestaurantStateView.Initialize(); _todayRestaurantStateView.Initialize();
} }

View File

@ -10,7 +10,7 @@ public void OnAdded(ItemSlotUi itemSlotUi)
if (inventorySlotUiStrategy.CanCrafting(itemSlotUi)) if (inventorySlotUiStrategy.CanCrafting(itemSlotUi))
{ {
RestaurantState.instance.ManagementState.TryAddTodayMenu(itemSlotUi.Model); RestaurantController.Instance.RestaurantState.ManagementState.TryAddTodayMenu(itemSlotUi.Model);
} }
else else
{ {
@ -25,7 +25,7 @@ public void OnRemoved(ItemSlotUi itemSlotUi)
{ {
if (itemSlotUi.Strategy is InventorySlotUiStrategy) return; if (itemSlotUi.Strategy is InventorySlotUiStrategy) return;
RestaurantState.instance.ManagementState.TryRemoveTodayMenu(itemSlotUi.Model); RestaurantController.Instance.RestaurantState.ManagementState.TryRemoveTodayMenu(itemSlotUi.Model);
} }
} }
} }

View File

@ -35,7 +35,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
} }
string markSpriteKey = null; string markSpriteKey = null;
if (RestaurantState.instance.ManagementState.IsCookwareMatched(ui.Model.Id)) if (RestaurantController.Instance.RestaurantState.ManagementState.IsCookwareMatched(ui.Model.Id))
{ {
markSpriteKey = SpriteConstants.CheckYesSpriteKey; markSpriteKey = SpriteConstants.CheckYesSpriteKey;
} }
@ -51,7 +51,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
public RuntimeAnimatorController GetAnimatorController() public RuntimeAnimatorController GetAnimatorController()
{ {
return RestaurantDataSo.instance.ManagementData.TodayMenuSlotUiAnimatorController; return RestaurantController.Instance.RestaurantData.ManagementData.TodayMenuSlotUiAnimatorController;
} }
} }
} }

View File

@ -12,8 +12,8 @@ public class TodayMenuView : MonoBehaviour, IEventHandler<TodayMenuAddedEvent>,
private List<ItemSlotUi> _foodSlots; private List<ItemSlotUi> _foodSlots;
private List<ItemSlotUi> _drinkSlots; private List<ItemSlotUi> _drinkSlots;
private RestaurantManagementStateSo restaurantManagementStateSo; private RestaurantManagementState restaurantManagementStateSo;
private RestaurantManagementDataSo restaurantManagementDataSo; private RestaurantManagementData restaurantManagementDataSo;
private void OnDestroy() private void OnDestroy()
{ {
@ -23,8 +23,8 @@ private void OnDestroy()
public void Initialize() public void Initialize()
{ {
restaurantManagementStateSo = RestaurantState.instance.ManagementState; restaurantManagementStateSo = RestaurantController.Instance.RestaurantState.ManagementState;
restaurantManagementDataSo = RestaurantDataSo.instance.ManagementData; restaurantManagementDataSo = RestaurantController.Instance.RestaurantData.ManagementData;
foreach (Transform child in _todayFoodContent) foreach (Transform child in _todayFoodContent)
{ {

View File

@ -10,7 +10,7 @@ public void OnAdded(ItemSlotUi itemSlotUi)
if (inventorySlotUiStrategy.CanCrafting(itemSlotUi)) if (inventorySlotUiStrategy.CanCrafting(itemSlotUi))
{ {
RestaurantState.instance.ManagementState.TryAddTodayCookware(itemSlotUi.Model); RestaurantController.Instance.RestaurantState.ManagementState.TryAddTodayCookware(itemSlotUi.Model);
} }
else else
{ {
@ -25,7 +25,7 @@ public void OnRemoved(ItemSlotUi itemSlotUi)
{ {
if (itemSlotUi.Strategy is InventorySlotUiStrategy) return; if (itemSlotUi.Strategy is InventorySlotUiStrategy) return;
RestaurantState.instance.ManagementState.TryRemoveTodayCookware(itemSlotUi.Model); RestaurantController.Instance.RestaurantState.ManagementState.TryRemoveTodayCookware(itemSlotUi.Model);
} }
} }
} }

View File

@ -18,7 +18,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
} }
string markSpriteKey = null; string markSpriteKey = null;
if (RestaurantState.instance.ManagementState.IsTodayMenuMatched(ui.Model.Id)) if (RestaurantController.Instance.RestaurantState.ManagementState.IsTodayMenuMatched(ui.Model.Id))
{ {
markSpriteKey = SpriteConstants.CheckYesSpriteKey; markSpriteKey = SpriteConstants.CheckYesSpriteKey;
} }
@ -34,7 +34,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
public RuntimeAnimatorController GetAnimatorController() public RuntimeAnimatorController GetAnimatorController()
{ {
return RestaurantDataSo.instance.ManagementData.TodayMenuSlotUiAnimatorController; return RestaurantController.Instance.RestaurantData.ManagementData.TodayMenuSlotUiAnimatorController;
} }
} }
} }

View File

@ -12,8 +12,8 @@ public class TodayRestaurantStateView : MonoBehaviour, IEventHandler<TodayMenuAd
private List<ItemSlotUi> _workerSlots; private List<ItemSlotUi> _workerSlots;
private List<ItemSlotUi> _cookwareSlots; private List<ItemSlotUi> _cookwareSlots;
private RestaurantManagementStateSo restaurantManagementStateSo; private RestaurantManagementState restaurantManagementStateSo;
private RestaurantManagementDataSo restaurantManagementDataSo; private RestaurantManagementData restaurantManagementDataSo;
private void OnDestroy() private void OnDestroy()
{ {
@ -23,8 +23,8 @@ private void OnDestroy()
public void Initialize() public void Initialize()
{ {
restaurantManagementStateSo = RestaurantState.instance.ManagementState; restaurantManagementStateSo = RestaurantController.Instance.RestaurantState.ManagementState;
restaurantManagementDataSo = RestaurantDataSo.instance.ManagementData; restaurantManagementDataSo = RestaurantController.Instance.RestaurantData.ManagementData;
foreach (Transform child in _todayWorkerContent) foreach (Transform child in _todayWorkerContent)
{ {

View File

@ -26,7 +26,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
public RuntimeAnimatorController GetAnimatorController() public RuntimeAnimatorController GetAnimatorController()
{ {
return RestaurantDataSo.instance.ManagementData.TodayMenuSlotUiAnimatorController; return RestaurantController.Instance.RestaurantData.ManagementData.TodayMenuSlotUiAnimatorController;
} }
} }
} }

View File

@ -0,0 +1,47 @@
using UnityEngine;
namespace DDD
{
public class RestaurantPlayerAnimation : RestaurantCharacterAnimation
{
private RestaurantPlayerMovement _restaurantPlayerMovement;
protected override void Awake()
{
base.Awake();
_restaurantPlayerMovement = GetComponent<RestaurantPlayerMovement>();
}
protected override void Start()
{
base.Start();
_restaurantPlayerMovement.OnMoving += OnMove;
_restaurantPlayerMovement.OnDashing += OnDash;
}
protected override void OnDestroy()
{
base.OnDestroy();
if (_restaurantPlayerMovement)
{
_restaurantPlayerMovement.OnMoving -= OnMove;
_restaurantPlayerMovement.OnDashing -= OnDash;
}
}
private void OnMove(bool isMoving)
{
string animationName = isMoving ? RestaurantPlayerAnimationType.Walk : RestaurantPlayerAnimationType.Idle;
_spineController.PlayAnimation(animationName, true);
}
private void OnDash(float dashTime)
{
_spineController.PlayAnimationDuration(RestaurantPlayerAnimationType.Dash, false, duration:dashTime);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6ea5b6b4333d6fa4392d4d0a09d97242

View File

@ -5,11 +5,11 @@ namespace DDD
{ {
public class RestaurantPlayerInput : MonoBehaviour public class RestaurantPlayerInput : MonoBehaviour
{ {
private RestaurantPlayerDataSo _playerDataSo; private RestaurantPlayerData _playerDataSo;
private void Start() private void Start()
{ {
_playerDataSo = RestaurantDataSo.instance.PlayerData; _playerDataSo = RestaurantController.Instance.RestaurantData.PlayerData;
_playerDataSo.OpenManagementUiAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.OpenManagementUi)); _playerDataSo.OpenManagementUiAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.OpenManagementUi));
_playerDataSo.OpenManagementUiAction.performed += OnOpenManagementUi; _playerDataSo.OpenManagementUiAction.performed += OnOpenManagementUi;

View File

@ -6,7 +6,7 @@ namespace DDD
{ {
public class RestaurantPlayerInteraction : RestaurantCharacterInteraction public class RestaurantPlayerInteraction : RestaurantCharacterInteraction
{ {
private RestaurantPlayerDataSo _restaurantPlayerDataSo; private RestaurantPlayerData _restaurantPlayerDataSo;
protected override void Start() protected override void Start()
{ {
@ -17,7 +17,7 @@ protected override void Start()
private Task Initialize() private Task Initialize()
{ {
_restaurantPlayerDataSo = RestaurantDataSo.instance.PlayerData; _restaurantPlayerDataSo = RestaurantController.Instance.RestaurantData.PlayerData;
Debug.Assert(_restaurantPlayerDataSo != null, "_restaurantPlayerDataSo is null"); Debug.Assert(_restaurantPlayerDataSo != null, "_restaurantPlayerDataSo is null");
_restaurantPlayerDataSo!.InteractAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Interact)); _restaurantPlayerDataSo!.InteractAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.Interact));

View File

@ -13,7 +13,7 @@ public class RestaurantPlayerMovement : RestaurantCharacterMovement, ICurrentDir
private Rigidbody _rigidbody; private Rigidbody _rigidbody;
private BoxCollider _boxCollider; private BoxCollider _boxCollider;
private RestaurantPlayerDataSo _playerDataSo; private RestaurantPlayerData _playerDataSo;
private Vector3 _inputDirection; private Vector3 _inputDirection;
private Vector3 _currentDirection; private Vector3 _currentDirection;
@ -81,7 +81,7 @@ private System.Threading.Tasks.Task InitializePlayerData()
{ {
try try
{ {
_playerDataSo = RestaurantDataSo.instance.PlayerData; _playerDataSo = RestaurantController.Instance.RestaurantData.PlayerData;
SubscribeToInputEvents(); SubscribeToInputEvents();
_isInitialized = true; _isInitialized = true;
} }
@ -294,13 +294,13 @@ public MovementDebugVisualizer(Transform transform)
} }
public void UpdateVisualization(Vector3 position, Vector3 inputDirection, public void UpdateVisualization(Vector3 position, Vector3 inputDirection,
Vector3 currentVelocity, RestaurantPlayerDataSo playerDataSo) Vector3 currentVelocity, RestaurantPlayerData playerDataSo)
{ {
UpdateInputLine(position, inputDirection, playerDataSo); UpdateInputLine(position, inputDirection, playerDataSo);
UpdateVelocityLine(position, currentVelocity, playerDataSo); UpdateVelocityLine(position, currentVelocity, playerDataSo);
} }
private void UpdateInputLine(Vector3 origin, Vector3 inputDirection, RestaurantPlayerDataSo playerDataSo) private void UpdateInputLine(Vector3 origin, Vector3 inputDirection, RestaurantPlayerData playerDataSo)
{ {
if (inputDirection != Vector3.zero) if (inputDirection != Vector3.zero)
{ {
@ -324,7 +324,7 @@ private void UpdateInputLine(Vector3 origin, Vector3 inputDirection, RestaurantP
} }
} }
private void UpdateVelocityLine(Vector3 origin, Vector3 velocity, RestaurantPlayerDataSo playerDataSo) private void UpdateVelocityLine(Vector3 origin, Vector3 velocity, RestaurantPlayerData playerDataSo)
{ {
float speed = velocity.magnitude; float speed = velocity.magnitude;
if (speed > playerDataSo.VelocityMinThreshold) if (speed > playerDataSo.VelocityMinThreshold)

View File

@ -4,39 +4,21 @@ namespace DDD
{ {
public class RestaurantCharacterAnimation : MonoBehaviour public class RestaurantCharacterAnimation : MonoBehaviour
{ {
private RestaurantPlayerMovement _restaurantPlayerMovement; protected SpineController _spineController;
private SpineController _spineController;
private void Awake() protected virtual void Awake()
{ {
_restaurantPlayerMovement = GetComponent<RestaurantPlayerMovement>();
_spineController = GetComponent<SpineController>(); _spineController = GetComponent<SpineController>();
} }
private void Start() protected virtual void Start()
{ {
_restaurantPlayerMovement.OnMoving += OnMove;
_restaurantPlayerMovement.OnDashing += OnDash;
} }
private void OnDestroy() protected virtual void OnDestroy()
{ {
if (_restaurantPlayerMovement)
{
_restaurantPlayerMovement.OnMoving -= OnMove;
_restaurantPlayerMovement.OnDashing -= OnDash;
}
}
private void OnMove(bool isMoving)
{
string animationName = isMoving ? RestaurantPlayerAnimation.Walk : RestaurantPlayerAnimation.Idle;
_spineController.PlayAnimation(animationName, true);
}
private void OnDash(float dashTime)
{
_spineController.PlayAnimationDuration(RestaurantPlayerAnimation.Dash, false, duration:dashTime);
} }
public bool IsPlayingAnimation() public bool IsPlayingAnimation()

View File

@ -5,7 +5,7 @@ namespace DDD
{ {
public class RestaurantEnvironmentController : FlowController public class RestaurantEnvironmentController : FlowController
{ {
private RestaurantEnvironmentStateSo _environmentState; private RestaurantEnvironmentState _environmentState;
public override Task InitializeController() public override Task InitializeController()
{ {
return Task.CompletedTask; return Task.CompletedTask;
@ -13,7 +13,7 @@ public override Task InitializeController()
public override Task InitializeState() public override Task InitializeState()
{ {
_environmentState = RestaurantState.instance.EnvironmentState; _environmentState = RestaurantController.Instance.RestaurantState.EnvironmentState;
return Task.CompletedTask; return Task.CompletedTask;
} }

View File

@ -13,7 +13,7 @@ public override Task InitializeController()
public override Task InitializeState() public override Task InitializeState()
{ {
// Load default asset // Load default asset
RestaurantState.instance.ManagementState.InitializeReadyForRestaurant(); RestaurantController.Instance.RestaurantState.ManagementState.InitializeReadyForRestaurant();
return Task.CompletedTask; return Task.CompletedTask;
} }

View File

@ -5,10 +5,10 @@ namespace DDD
{ {
public class RestaurantRunController : FlowController public class RestaurantRunController : FlowController
{ {
RestaurantCustomerStateSo _restaurantCustomerStateSo; RestaurantCustomerState _restaurantCustomerStateSo;
public override Task InitializeController() public override Task InitializeController()
{ {
_restaurantCustomerStateSo = RestaurantState.instance.CustomerState; _restaurantCustomerStateSo = RestaurantController.Instance.RestaurantState.CustomerState;
return Task.CompletedTask; return Task.CompletedTask;
} }

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 545b3710d04aa3e48923f79f03b5dfc5

View File

@ -15,7 +15,7 @@ public override Task RunFlowTask()
{ {
// TODO : Base prefab from EnvironmentDataSo // TODO : Base prefab from EnvironmentDataSo
var props = RestaurantState.instance.EnvironmentState.Props; var props = RestaurantController.Instance.RestaurantState.EnvironmentState.Props;
foreach (var prop in props) foreach (var prop in props)
{ {
// TODO : Instantiate and Initialize // TODO : Instantiate and Initialize

View File

@ -20,7 +20,7 @@ public override Task RunFlowTask()
return Task.CompletedTask; return Task.CompletedTask;
} }
var playerPrefab = RestaurantDataSo.instance.PlayerData.PlayerPrefab; var playerPrefab = RestaurantController.Instance.RestaurantData.PlayerData.PlayerPrefab;
if (playerPrefab == null) if (playerPrefab == null)
{ {
Debug.LogError("PlayerPrefab이 설정되지 않았습니다!"); Debug.LogError("PlayerPrefab이 설정되지 않았습니다!");

View File

@ -2,11 +2,19 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.AddressableAssets;
namespace DDD namespace DDD
{ {
public class RestaurantController : Singleton<RestaurantController>, IManager, IGameFlowHandler public class RestaurantController : Singleton<RestaurantController>, IManager, IGameFlowHandler
{ {
[SerializeField] private AssetReference _restaurantData;
public RestaurantData RestaurantData { get; private set; }
public RestaurantState RestaurantState { get; private set; }
private List<FlowController> _restaurantFlowControllers = new();
// static definitions // static definitions
private static readonly List<Type> RestaurantFlowControllerTypes = new() private static readonly List<Type> RestaurantFlowControllerTypes = new()
{ {
@ -17,20 +25,16 @@ public class RestaurantController : Singleton<RestaurantController>, IManager, I
typeof(RestaurantGlobalMessageController) typeof(RestaurantGlobalMessageController)
}; };
public RestaurantState GetRestaurantState() => RestaurantState.instance;
public RestaurantDataSo RestaurantData() => RestaurantDataSo.instance;
private List<FlowController> _restaurantFlowControllers = new();
public void PreInit() public void PreInit()
{ {
LoadOrCreateRestaurantState();
RegisterFlowHandler(); RegisterFlowHandler();
} }
public async Task Init() public async Task Init()
{ {
await LoadData(); await LoadData();
await RestaurantDataSo.instance.LoadData(); await RestaurantData.LoadData();
await InitializeAllFlowControllers(); await InitializeAllFlowControllers();
} }
@ -38,6 +42,12 @@ public void PostInit()
{ {
} }
private void LoadOrCreateRestaurantState()
{
// TODO : Load states from saved files. if none, create them.
RestaurantState = ScriptableObject.CreateInstance<RestaurantState>();
}
private void RegisterFlowHandler() private void RegisterFlowHandler()
{ {
GameFlowManager.Instance.FlowHandlers.Add(this); GameFlowManager.Instance.FlowHandlers.Add(this);
@ -61,9 +71,15 @@ private async Task InitializeAllFlowControllers()
} }
} }
private Task LoadData() private async Task LoadData()
{ {
return Task.CompletedTask; var restaurantDataHandle = _restaurantData.LoadAssetAsync<RestaurantData>();
await restaurantDataHandle.Task;
RestaurantData = restaurantDataHandle.Result;
Debug.Assert(RestaurantData != null, "RestaurantData is null");
} }
public async Task OnReadyNewFlow(GameFlowState newFlowState) public async Task OnReadyNewFlow(GameFlowState newFlowState)

View File

@ -1,10 +1,9 @@
using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
namespace DDD namespace DDD
{ {
[CreateAssetMenu(fileName = "RestaurantManagementDataSo", menuName = "RestaurantData/RestaurantManagementDataSo", order = 0)] [CreateAssetMenu(fileName = "RestaurantManagementData", menuName = "RestaurantData/RestaurantManagementData")]
public class RestaurantManagementDataSo : ScriptableObject public class RestaurantManagementData : ScriptableObject
{ {
public ItemSlotUi ItemSlotUiPrefab; public ItemSlotUi ItemSlotUiPrefab;
public TasteHashTagSlotUi TasteHashTagSlotUiPrefab; public TasteHashTagSlotUi TasteHashTagSlotUiPrefab;

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 08fe1f67882cd7e459327a221731e453

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 3aa53e94b0504f26bb0cee017d1dddbc
timeCreated: 1755167516

View File

@ -3,22 +3,22 @@
namespace DDD namespace DDD
{ {
[CreateAssetMenu(fileName = "RestaurantPlayerDataSo", menuName = "RestaurantData/RestaurantPlayerDataSo")] [CreateAssetMenu(fileName = "RestaurantPlayerData", menuName = "RestaurantData/RestaurantPlayerData")]
public class RestaurantPlayerDataSo : ScriptableObject public class RestaurantPlayerData : ScriptableObject
{ {
public GameObject PlayerPrefab; public GameObject PlayerPrefab;
public bool IsDrawLineDebug = true; public bool IsDrawLineDebug = true;
public bool IsMoveEnabled = true; public bool IsMoveEnabled = true;
public float MoveSpeed = 7f; public float MoveSpeed = 8.5f;
public float Acceleration = 70f; public float Acceleration = 70f;
public float Deceleration = 350f; public float Deceleration = 350f;
public bool IsDashEnabled = true; public bool IsDashEnabled = true;
public float DashSpeed = 20f; public float DashSpeed = 20f;
public float DashTime = 0.2f; public float DashTime = 0.2f;
public float DashCooldown = 2f; public float DashCooldown = 0.5f;
[Tooltip("슬라이딩이 적용되지 않는 충돌체 레이어 (Ground 등)")] [Tooltip("슬라이딩이 적용되지 않는 충돌체 레이어 (Ground 등)")]
public LayerMask IgnoreSlidingLayerMask; public LayerMask IgnoreSlidingLayerMask;

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 371f83c380e45a24fabb460707edb4fe

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5583898a24cc9c7419aec8b01ee0fde4

View File

@ -0,0 +1,50 @@
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;
namespace DDD
{
[CreateAssetMenu(fileName = "RestaurantData", menuName = "RestaurantData/RestaurantData", order = 0)]
public class RestaurantData : ScriptableObject
{
[SerializeField] private AssetReference _restaurantPlayerData;
[SerializeField] private AssetReference _restaurantManagementData;
public RestaurantPlayerData PlayerData { get; private set; }
public RestaurantManagementData ManagementData { get; private set; }
private bool _isLoaded;
public async Task LoadData()
{
if (_isLoaded)
{
return;
}
var restaurantPlayerDataHandle = _restaurantPlayerData.LoadAssetAsync<RestaurantPlayerData>();
var restaurantManagementDataHandle = _restaurantManagementData.LoadAssetAsync<RestaurantManagementData>();
await restaurantPlayerDataHandle.Task;
await restaurantManagementDataHandle.Task;
PlayerData = restaurantPlayerDataHandle.Result;
ManagementData = restaurantManagementDataHandle.Result;
Debug.Assert(PlayerData != null, "RestaurantPlayerData is null");
Debug.Assert(ManagementData != null, "RestaurantManagementData is null");
_isLoaded = true;
}
private void OnDisable()
{
if (_isLoaded == false) return;
_restaurantPlayerData.ReleaseAsset();
_restaurantManagementData.ReleaseAsset();
_isLoaded = false;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7629f78e30fa6a24d9fa5d09124410e4

View File

@ -1,53 +0,0 @@
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
namespace DDD
{
[CreateAssetMenu(fileName = "RestaurantDataSo", menuName = "RestaurantData/RestaurantDataSo", order = 0)]
public class RestaurantDataSo : ScriptableSingleton<RestaurantDataSo>
{
[Header("Asset References")]
[SerializeField] private AssetReference _restaurantPlayerDataSo;
[SerializeField] private AssetReference _restaurantManagementDataSo;
public RestaurantPlayerDataSo PlayerData { get; private set; }
public RestaurantManagementDataSo ManagementData { get; private set; }
private bool _isLoaded;
public async Task LoadData()
{
if (_isLoaded)
{
return;
}
var playerHandle = _restaurantPlayerDataSo.LoadAssetAsync<RestaurantPlayerDataSo>();
var managementHandle = _restaurantManagementDataSo.LoadAssetAsync<RestaurantManagementDataSo>();
await playerHandle.Task;
await managementHandle.Task;
PlayerData = playerHandle.Result;
ManagementData = managementHandle.Result;
Debug.Assert(PlayerData != null, "PlayerData is null");
Debug.Assert(ManagementData != null, "ManagementData is null");
_isLoaded = true;
}
private void OnDisable()
{
if (!_isLoaded) return;
_restaurantPlayerDataSo.ReleaseAsset();
_restaurantManagementDataSo.ReleaseAsset();
_isLoaded = false;
}
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: f47eda10f73c497d9894967fae3cd2d8
timeCreated: 1755165774

View File

@ -13,9 +13,9 @@ public bool ExecuteInteraction(IInteractor interactor, IInteractable interactabl
return true; return true;
} }
private RestaurantManagementStateSo GetManagementState() private RestaurantManagementState GetManagementState()
{ {
return RestaurantState.instance.ManagementState; return RestaurantController.Instance.RestaurantState.ManagementState;
} }
public bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payloadSo = null) public bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payloadSo = null)

View File

@ -4,13 +4,11 @@
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
namespace DDD namespace DDD
{ {
[CreateAssetMenu(fileName = "RestaurantCustomerStateSo", menuName = "RestaurantState/RestaurantCustomerStateSo")] public class RestaurantCustomerState : ScriptableObject, IGameFlowHandler
public class RestaurantCustomerStateSo : ScriptableObject, IGameFlowHandler
{ {
[Title("스폰 제어")] [Title("스폰 제어")]
[Tooltip("플로우 시작 후 첫 손님이 등장하기까지 대기 시간(초)")] [Tooltip("플로우 시작 후 첫 손님이 등장하기까지 대기 시간(초)")]
@ -53,7 +51,7 @@ private async Task InitializeRunRestaurant()
{ {
_iCustomerFactory = new CustomerFactory(); _iCustomerFactory = new CustomerFactory();
var currentGameLevel = GameStateSo.instance.GameLevelStateSo.Level; var currentGameLevel = GameController.Instance.GameState.LevelState.Level;
if (_levelDataSo == null) if (_levelDataSo == null)
{ {
_levelDataSo = DataManager.Instance.GetDataSo<LevelDataSo>(); _levelDataSo = DataManager.Instance.GetDataSo<LevelDataSo>();

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3d17772ed772b03418ae2167783a305c

View File

@ -17,7 +17,7 @@ public RestaurantPropLocation(string id, Vector2 position)
} }
} }
public class RestaurantEnvironmentStateSo : ScriptableObject public class RestaurantEnvironmentState : ScriptableObject
{ {
public List<RestaurantPropLocation> Props = new List<RestaurantPropLocation>(); public List<RestaurantPropLocation> Props = new List<RestaurantPropLocation>();
public List<RestaurantPropLocation> Objects = new List<RestaurantPropLocation>(); public List<RestaurantPropLocation> Objects = new List<RestaurantPropLocation>();

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 455a13ee6f37a9045b991a04bd50990e

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 0c87c6773ca54d81ab1d8c2e218081c4
timeCreated: 1752729814

View File

@ -1,12 +1,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
namespace DDD namespace DDD
{ {
public class RestaurantManagementStateSo : ScriptableObject public class RestaurantManagementState : ScriptableObject
{ {
// TODO : 데이터에서 초기화하고, 동적으로 변경 // TODO : 데이터에서 초기화하고, 동적으로 변경
[Title("오늘의 레스토랑 상태")] [Title("오늘의 레스토랑 상태")]
@ -85,9 +84,9 @@ public bool IsOpenable()
return _isOpenable; return _isOpenable;
} }
public RestaurantManagementDataSo GetManagementData() public RestaurantManagementData GetManagementData()
{ {
return RestaurantDataSo.instance.ManagementData; return RestaurantController.Instance.RestaurantData.ManagementData;
} }
public bool TryAddTodayMenu(ItemViewModel model) public bool TryAddTodayMenu(ItemViewModel model)

View File

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

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 417ea9eca99e49afbf587feb3ca92d1b
timeCreated: 1753423256

View File

@ -0,0 +1,9 @@
using UnityEngine;
namespace DDD
{
public class RestaurantPlayerState : ScriptableObject
{
}
}

View File

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

View File

@ -1,9 +0,0 @@
using UnityEngine;
namespace DDD
{
public class RestaurantPlayerStateSo : ScriptableObject
{
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: cc65892536714c08bc2cd202851e0c0f
timeCreated: 1755168640

View File

@ -2,7 +2,7 @@
namespace DDD namespace DDD
{ {
public class RestaurantRunStateSo : ScriptableObject public class RestaurantRunState : ScriptableObject
{ {
} }

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6aa8d89cce5661e4e8719edbeb38d268

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 692fb4e2437a48768e4bcf5a57d2883d
timeCreated: 1755153808

View File

@ -1,24 +1,22 @@
using UnityEditor;
using UnityEngine; using UnityEngine;
namespace DDD namespace DDD
{ {
public class RestaurantState : ScriptableSingleton<RestaurantState> public class RestaurantState : ScriptableObject
{ {
public RestaurantManagementStateSo ManagementState { get; private set; } public RestaurantManagementState ManagementState { get; private set; }
public RestaurantRunStateSo RunState { get; private set; } public RestaurantRunState RunState { get; private set; }
public RestaurantEnvironmentStateSo EnvironmentState { get; private set; } public RestaurantEnvironmentState EnvironmentState { get; private set; }
public RestaurantPlayerStateSo PlayerState { get; private set; } public RestaurantPlayerState PlayerState { get; private set; }
public RestaurantCustomerStateSo CustomerState { get; private set; } public RestaurantCustomerState CustomerState { get; private set; }
// TODO : Load from disk(SaveData)
private void OnEnable() private void OnEnable()
{ {
ManagementState = CreateInstance<RestaurantManagementStateSo>(); ManagementState = CreateInstance<RestaurantManagementState>();
RunState = CreateInstance<RestaurantRunStateSo>(); RunState = CreateInstance<RestaurantRunState>();
EnvironmentState = CreateInstance<RestaurantEnvironmentStateSo>(); EnvironmentState = CreateInstance<RestaurantEnvironmentState>();
PlayerState = CreateInstance<RestaurantPlayerStateSo>(); PlayerState = CreateInstance<RestaurantPlayerState>();
CustomerState = CreateInstance<RestaurantCustomerStateSo>(); CustomerState = CreateInstance<RestaurantCustomerState>();
} }
} }
} }

View File

@ -35,7 +35,7 @@ public static class DataConstants
public const string CustomerNpcPrefab = "CustomerNpc"; public const string CustomerNpcPrefab = "CustomerNpc";
} }
public static class RestaurantPlayerAnimation public static class RestaurantPlayerAnimationType
{ {
public const string Idle = "Idle"; public const string Idle = "Idle";
public const string Walk = "RunFast"; public const string Walk = "RunFast";