상호작용 메세지 로직 완성

This commit is contained in:
NTG 2025-08-28 20:00:22 +09:00
parent b9e31ce74d
commit 33db6a1c6c
59 changed files with 3866 additions and 107 deletions

Binary file not shown.

View File

@ -426,7 +426,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 81e01dd8c1cc3404d805400eba1bb4ae, type: 3}
m_Name:
m_EditorClassIdentifier:
_availableInteractions: 7
_availableInteractions: 15
_nearColliders:
- {fileID: 0}
- {fileID: 0}

View File

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

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,10 +8,10 @@ namespace DDD
{
public class DataManager : Singleton<DataManager>, IManager
{
private readonly Dictionary<Type, ScriptableObject> _dataSoTable = new();
private Dictionary<Type, ScriptableObject> _dataAssetTable = new();
private Dictionary<string, Sprite> _spriteAtlas;
private const string SoLabel = "GoogleSheetSo";
private const string AssetLabel = "GoogleSheetSo";
private const string Icon = "_icon";
public void PreInit()
@ -32,15 +32,15 @@ public void PostInit()
private async Task LoadAllGameDataSo()
{
var soList = await AssetManager.Instance.LoadAssetsByLabel<ScriptableObject>(SoLabel);
foreach (var so in soList)
var assets = await AssetManager.Instance.LoadAssetsByLabel<ScriptableObject>(AssetLabel);
_dataAssetTable = new Dictionary<Type, ScriptableObject>(assets.Count);
foreach (var asset in assets)
{
var type = so.GetType();
_dataSoTable.TryAdd(type, so);
var type = asset.GetType();
_dataAssetTable.TryAdd(type, asset);
}
Debug.Log($"[DataManager] {_dataSoTable.Count}개의 SO가 로드되었습니다.");
Debug.Log($"[DataManager] {_dataAssetTable.Count}개의 DataAsset이 로드되었습니다.");
}
private async Task LoadSpriteAtlas()
@ -68,14 +68,14 @@ private async Task LoadSpriteAtlas()
}
}
public T GetDataSo<T>() where T : ScriptableObject
public T GetDataAsset<T>() where T : ScriptableObject
{
if (_dataSoTable.TryGetValue(typeof(T), out var so))
if (_dataAssetTable.TryGetValue(typeof(T), out var so))
{
return so as T;
}
Debug.LogError($"[DataManager] {typeof(T).Name} SO를 찾을 수 없습니다.");
Debug.LogError($"[DataManager] {typeof(T).Name} 찾을 수 없습니다.");
return null;
}

View File

@ -48,7 +48,7 @@ public void PostInit()
private void InitializeItemData()
{
var itemDataSo = DataManager.Instance.GetDataSo<ItemDataAsset>();
var itemDataSo = DataManager.Instance.GetDataAsset<ItemDataAsset>();
Debug.Assert(itemDataSo != null, "itemDataSo != null");
_allItemDataLookup = itemDataSo.GetDataList()

View File

@ -47,10 +47,10 @@ private void RemoveItem()
private IEnumerable<string> GetItemIds()
{
if (!Application.isPlaying || DataManager.Instance?.GetDataSo<ItemDataAsset>() == null)
if (!Application.isPlaying || DataManager.Instance?.GetDataAsset<ItemDataAsset>() == null)
return Enumerable.Empty<string>();
return DataManager.Instance.GetDataSo<ItemDataAsset>().GetDataList()
return DataManager.Instance.GetDataAsset<ItemDataAsset>().GetDataList()
.Select(data => data.Id)
.Where(id => !string.IsNullOrEmpty(id));
}

Binary file not shown.

View File

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

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b10bc2081be2cab46a268b145b132a10
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: da8fcc1f4658c38469681f2d9da7e72a
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -987,7 +987,7 @@
"CookwareKey:string": "item_environment_cookware_001",
"CookTime:int": 10,
"Price:int": 30,
"IngredientKey1:string": "item_ingredient_005",
"IngredientKey1:string": "item_ingredient_012",
"IngredientAmount1:string": 1,
"IngredientKey2:string": "item_ingredient_006",
"IngredientAmount2:string": 2,
@ -1755,5 +1755,56 @@
"SpriteKey:string": "",
"Size:float": 1
}
],
"InteractionData": [
{
"Id": "식별ID",
"#설명": "설명",
"UnparsedInteractionType:string": "파싱 전 타입",
"DefaultMessageKey:string": "상호작용 기본 현지화 키 값",
"ConditionalMessageKey:string": "상호작용 예외처리 현지화 키 값"
},
{
"Id": "interaction_001",
"#설명": "준비단계 - 메뉴 ui 오픈",
"UnparsedInteractionType:string": "RestaurantManagement.OpenManagementUi",
"DefaultMessageKey:string": "interaction_001_default",
"ConditionalMessageKey:string": ""
},
{
"Id": "interaction_002",
"#설명": "준비단계 - 레스토랑 오픈",
"UnparsedInteractionType:string": "RestaurantManagement.RunRestaurant",
"DefaultMessageKey:string": "interaction_002_default",
"ConditionalMessageKey:string": "interaction_002_failure"
},
{
"Id": "interaction_003",
"#설명": "운영중 - 손님 주문 받기",
"UnparsedInteractionType:string": "RestaurantOrder.Order",
"DefaultMessageKey:string": "interaction_003_default",
"ConditionalMessageKey:string": ""
},
{
"Id": "interaction_004",
"#설명": "운영중 - 요리 서빙하기",
"UnparsedInteractionType:string": "RestaurantOrder.Serve",
"DefaultMessageKey:string": "interaction_004_default",
"ConditionalMessageKey:string": ""
},
{
"Id": "interaction_005",
"#설명": "운영중 - 테이블 치우기",
"UnparsedInteractionType:string": "RestaurantOrder.Dirty",
"DefaultMessageKey:string": "interaction_005_default",
"ConditionalMessageKey:string": ""
},
{
"Id": "interaction_006",
"#설명": "운영중 - 요리도구를 통해 요리 ui 오픈",
"UnparsedInteractionType:string": "RestaurantCook.OpenCookUi",
"DefaultMessageKey:string": "interaction_006_default",
"ConditionalMessageKey:string": ""
}
]
}

View File

@ -31,7 +31,7 @@ public override Task OnExitCurrentFlow(GameFlowState exitingFlowState)
private void GenerateDummyEnvironmentProps()
{
// Make dummy placement data
foreach (EnvironmentDataEntry prop in DataManager.Instance.GetDataSo<EnvironmentDataAsset>().GetDataList())
foreach (EnvironmentDataEntry prop in DataManager.Instance.GetDataAsset<EnvironmentDataAsset>().GetDataList())
{
for (int i = 0; i < 10; i++)
{

View File

@ -71,9 +71,9 @@ public override Task OnExitCurrentFlow(GameFlowState exitingFlowState)
private async Task StartSpawnLoopAsync(CancellationToken token)
{
var currentGameLevel = GameState.Instance.LevelState.Level;
_levelDataAsset ??= DataManager.Instance.GetDataSo<LevelDataAsset>();
_customerDataAsset ??= DataManager.Instance.GetDataSo<CustomerDataAsset>();
_customerPoolDataAsset ??= DataManager.Instance.GetDataSo<CustomerPoolDataAsset>();
_levelDataAsset ??= DataManager.Instance.GetDataAsset<LevelDataAsset>();
_customerDataAsset ??= DataManager.Instance.GetDataAsset<CustomerDataAsset>();
_customerPoolDataAsset ??= DataManager.Instance.GetDataAsset<CustomerPoolDataAsset>();
var currentLevelData = _levelDataAsset.GetDataList().FirstOrDefault(data => data.Level == currentGameLevel);
Debug.Assert(currentLevelData != null, "currentLevelData is null");

View File

@ -40,6 +40,11 @@ public async Task Init()
public void PostInit()
{
var allInteractables = GetRestaurantState().EnvironmentState.GetAllInteractables();
foreach (var interactable in allInteractables)
{
}
}
private void CreateRestaurantState()

View File

@ -40,7 +40,7 @@ public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloa
public string GetCurrentSubsystemTypeName()
{
return nameof(_cookType);
return _cookType.ToString();
}
public ScriptableObject GetPayload()

View File

@ -41,7 +41,7 @@ public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = nu
public string GetCurrentSubsystemTypeName()
{
return nameof(_managementType);
return _managementType.ToString();
}
public ScriptableObject GetPayload()

View File

@ -49,7 +49,7 @@ public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = nu
public string GetCurrentSubsystemTypeName()
{
return nameof(_currentRestaurantMealType);
return _currentRestaurantMealType.ToString();
}
public ScriptableObject GetPayload()

View File

@ -47,7 +47,7 @@ public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = nu
public string GetCurrentSubsystemTypeName()
{
return nameof(_currentRestaurantOrderType);
return _currentRestaurantOrderType.ToString();
}
public ScriptableObject GetPayload()

View File

@ -16,7 +16,7 @@ public class RestaurantEnvironment : MonoBehaviour
public void Initialize(RestaurantPropLocation location)
{
EnvironmentDataEntry environmentDataEntry = DataManager.Instance.GetDataSo<EnvironmentDataAsset>().GetDataById(location.Id);
EnvironmentDataEntry environmentDataEntry = DataManager.Instance.GetDataAsset<EnvironmentDataAsset>().GetDataById(location.Id);
_collider = GetComponent<Collider>();
_rootObject = transform.Find(CommonConstants.RootObject);

View File

@ -102,7 +102,6 @@ public virtual void InitializeInteraction(InteractionType interactionType)
_isInitialized = true;
InitializeSubsystems();
SetDisplayParameters();
}
private void InitializeSubsystems()
@ -141,19 +140,15 @@ public virtual InteractionExecutionParameters GetExecutionParameters()
return _executionParameters;
}
private void SetDisplayParameters()
public virtual InteractionDisplayParameters GetDisplayParameters()
{
if (DataManager.Instance.GetDataSo<InteractionDataAsset>().TryGetValueByTypeName(nameof(_interactionType),
if (DataManager.Instance.GetDataAsset<InteractionDataAsset>().TryGetValueByTypeName(_interactionType.ToString(),
_subsystems[_interactionType].GetCurrentSubsystemTypeName(), out var interactionDataEntry) == false)
{
return;
return new InteractionDisplayParameters();
}
_displayParameters = new InteractionDisplayParameters(interactionDataEntry.DefaultMessageKey, interactionDataEntry.ConditionalMessageKey);
}
public virtual InteractionDisplayParameters GetDisplayParameters()
{
return _displayParameters;
}

View File

@ -79,7 +79,7 @@ public bool TryAddTodayMenu(ItemModel model)
if (model.ItemType != ItemType.Recipe) return false;
if (DataManager.Instance.GetDataSo<RecipeDataAsset>().TryGetDataById(recipeId, out RecipeDataEntry recipeData) == false) return false;
if (DataManager.Instance.GetDataAsset<RecipeDataAsset>().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<FoodDataAsset>().GetDataById(recipeData.RecipeResult);
var foodData = DataManager.Instance.GetDataAsset<FoodDataAsset>().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<DrinkDataAsset>().GetDataById(recipeData.RecipeResult);
var drinkData = DataManager.Instance.GetDataAsset<DrinkDataAsset>().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<RecipeDataAsset>().TryGetDataById(recipeId, out RecipeDataEntry recipeData) == false) return false;
if (DataManager.Instance.GetDataAsset<RecipeDataAsset>().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<FoodDataAsset>().GetDataById(recipeData.RecipeResult);
var foodData = DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(recipeData.RecipeResult);
foodData.RefundIngredients(refundCount);
}
}
@ -156,7 +156,7 @@ public bool TryRemoveTodayMenu(ItemModel model)
if (removed)
{
var drinkData = DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(recipeData.RecipeResult);
var drinkData = DataManager.Instance.GetDataAsset<DrinkDataAsset>().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<CookwareDataAsset>().ContainsData(cookwareId) == false) return false;
if (model.HasItem == false || DataManager.Instance.GetDataAsset<CookwareDataAsset>().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<CookwareDataAsset>().ContainsData(cookwareId) == false) return false;
if (DataManager.Instance.GetDataAsset<CookwareDataAsset>().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<RecipeDataAsset>().TryGetDataById(recipeId, out var recipeData) == false) return null;
if (DataManager.Instance.GetDataAsset<RecipeDataAsset>().TryGetDataById(recipeId, out var recipeData) == false) return null;
var resultKey = recipeData.RecipeResult;
return recipeData.RecipeType switch
{
RecipeType.FoodRecipe => DataManager.Instance.GetDataSo<FoodDataAsset>().GetDataById(resultKey).CookwareKey,
RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(resultKey).CookwareKey,
RecipeType.FoodRecipe => DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(resultKey).CookwareKey,
RecipeType.DrinkRecipe => DataManager.Instance.GetDataAsset<DrinkDataAsset>().GetDataById(resultKey).CookwareKey,
_ => null
};
}

View File

@ -89,7 +89,7 @@ public void SetCookwareType(CookwareType cookwareType)
if (_currentCookwareType == cookwareType) return;
_currentCookwareType = cookwareType;
var cookwareDatas = DataManager.Instance.GetDataSo<CookwareDataAsset>().GetDataList();
var cookwareDatas = DataManager.Instance.GetDataAsset<CookwareDataAsset>().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<CookwareDataAsset>().TryGetDataById(cookwareId, out var cookwareData) &&
if (DataManager.Instance.GetDataAsset<CookwareDataAsset>().TryGetDataById(cookwareId, out var cookwareData) &&
cookwareData.CookwareType == _currentCookwareType)
{
foreach (var recipeId in recipeIds)

View File

@ -15,7 +15,7 @@ public static List<IngredientEntry> GetIngredients(this DrinkDataEntry dataEntry
public static List<TasteDataEntry> GetTasteDatas(this DrinkDataEntry dataEntry)
=> CraftingHelper.ResolveTasteDatas(
new[] { dataEntry.TasteKey1, dataEntry.TasteKey2, dataEntry.TasteKey3, dataEntry.TasteKey4, dataEntry.TasteKey5, dataEntry.TasteKey6 },
DataManager.Instance.GetDataSo<TasteDataAsset>()
DataManager.Instance.GetDataAsset<TasteDataAsset>()
);
public static int GetCraftableCount(this DrinkDataEntry dataEntry)

View File

@ -14,7 +14,7 @@ public static List<IngredientEntry> GetIngredients(this FoodDataEntry dataEntry)
public static List<TasteDataEntry> GetTasteDatas(this FoodDataEntry dataEntry)
=> CraftingHelper.ResolveTasteDatas(
new[] { dataEntry.TasteKey1, dataEntry.TasteKey2, dataEntry.TasteKey3, dataEntry.TasteKey4, dataEntry.TasteKey5, dataEntry.TasteKey6 },
DataManager.Instance.GetDataSo<TasteDataAsset>()
DataManager.Instance.GetDataAsset<TasteDataAsset>()
);
public static int GetCraftableCount(this FoodDataEntry dataEntry)

View File

@ -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<RecipeDataAsset>().GetDataById(Id).RecipeType : RecipeType.None;
public RecipeType RecipeType => ItemType == ItemType.Recipe ? DataManager.Instance.GetDataAsset<RecipeDataAsset>().GetDataById(Id).RecipeType : RecipeType.None;
public Sprite ItemSprite
{
get
{
if (ItemType == ItemType.Recipe)
{
DataManager.Instance.GetDataSo<RecipeDataAsset>().TryGetDataById(Id, out var recipe);
DataManager.Instance.GetDataAsset<RecipeDataAsset>().TryGetDataById(Id, out var recipe);
return DataManager.Instance.GetSprite(recipe.RecipeResult);
}
if (DataManager.Instance.GetDataSo<CookwareDataAsset>().ContainsData(Id))
if (DataManager.Instance.GetDataAsset<CookwareDataAsset>().ContainsData(Id))
{
return DataManager.Instance.GetIcon(Id);
}
@ -52,7 +52,7 @@ public string GetRecipeResultKey
{
if (ItemType != ItemType.Recipe) return null;
return DataManager.Instance.GetDataSo<RecipeDataAsset>().GetDataById(Id).RecipeResult;
return DataManager.Instance.GetDataAsset<RecipeDataAsset>().GetDataById(Id).RecipeResult;
}
}
@ -65,8 +65,8 @@ public string GetCookwareKey
return RecipeType switch
{
RecipeType.FoodRecipe => DataManager.Instance.GetDataSo<FoodDataAsset>().GetDataById(resultKey).CookwareKey,
RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(resultKey).CookwareKey,
RecipeType.FoodRecipe => DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(resultKey).CookwareKey,
RecipeType.DrinkRecipe => DataManager.Instance.GetDataAsset<DrinkDataAsset>().GetDataById(resultKey).CookwareKey,
_ => null
};
}
@ -81,8 +81,8 @@ public int GetPrice
return RecipeType switch
{
RecipeType.FoodRecipe => DataManager.Instance.GetDataSo<FoodDataAsset>().GetDataById(resultKey).Price,
RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(resultKey).Price,
RecipeType.FoodRecipe => DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(resultKey).Price,
RecipeType.DrinkRecipe => DataManager.Instance.GetDataAsset<DrinkDataAsset>().GetDataById(resultKey).Price,
_ => -1
};
}
@ -98,11 +98,11 @@ public Sprite GetCookwareIcon
string cookwareKey = null;
if (RecipeType == RecipeType.FoodRecipe)
{
cookwareKey = DataManager.Instance.GetDataSo<FoodDataAsset>().GetDataById(resultKey).CookwareKey;
cookwareKey = DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(resultKey).CookwareKey;
}
else if (RecipeType == RecipeType.DrinkRecipe)
{
cookwareKey = DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(resultKey).CookwareKey;
cookwareKey = DataManager.Instance.GetDataAsset<DrinkDataAsset>().GetDataById(resultKey).CookwareKey;
}
return DataManager.Instance.GetIcon(cookwareKey);
}
@ -117,9 +117,9 @@ public List<IngredientEntry> GetIngredients
switch (RecipeType)
{
case RecipeType.FoodRecipe:
return DataManager.Instance.GetDataSo<FoodDataAsset>().GetDataById(GetRecipeResultKey).GetIngredients();
return DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(GetRecipeResultKey).GetIngredients();
case RecipeType.DrinkRecipe:
return DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(GetRecipeResultKey).GetIngredients();
return DataManager.Instance.GetDataAsset<DrinkDataAsset>().GetDataById(GetRecipeResultKey).GetIngredients();
}
return null;
@ -133,9 +133,9 @@ public List<TasteDataEntry> GetTasteDatas
switch (RecipeType)
{
case RecipeType.FoodRecipe:
return DataManager.Instance.GetDataSo<FoodDataAsset>().GetDataById(GetRecipeResultKey).GetTasteDatas();
return DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(GetRecipeResultKey).GetTasteDatas();
case RecipeType.DrinkRecipe:
return DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(GetRecipeResultKey).GetTasteDatas();
return DataManager.Instance.GetDataAsset<DrinkDataAsset>().GetDataById(GetRecipeResultKey).GetTasteDatas();
}
return null;
@ -153,12 +153,12 @@ public void UpdateCount()
if (RecipeType == RecipeType.FoodRecipe)
{
var foodData = DataManager.Instance.GetDataSo<FoodDataAsset>().GetDataById(resultKey);
var foodData = DataManager.Instance.GetDataAsset<FoodDataAsset>().GetDataById(resultKey);
craftableCount = foodData.GetCraftableCount();
}
else if (RecipeType == RecipeType.DrinkRecipe)
{
var drinkData = DataManager.Instance.GetDataSo<DrinkDataAsset>().GetDataById(resultKey);
var drinkData = DataManager.Instance.GetDataAsset<DrinkDataAsset>().GetDataById(resultKey);
craftableCount = drinkData.GetCraftableCount();
}

View File

@ -33,16 +33,16 @@ public static List<ItemModel> CreateRestaurantManagementInventoryItem()
private static int CalculateCraftableCount(string recipeId)
{
if (!DataManager.Instance.GetDataSo<RecipeDataAsset>().TryGetDataById(recipeId, out var recipe)) return 0;
if (!DataManager.Instance.GetDataAsset<RecipeDataAsset>().TryGetDataById(recipeId, out var recipe)) return 0;
string recipeResult = recipe.RecipeResult;
return recipe.RecipeType switch
{
RecipeType.FoodRecipe => DataManager.Instance.GetDataSo<FoodDataAsset>().TryGetDataById(recipeResult, out var food)
RecipeType.FoodRecipe => DataManager.Instance.GetDataAsset<FoodDataAsset>().TryGetDataById(recipeResult, out var food)
? food.GetCraftableCount()
: 0,
RecipeType.DrinkRecipe => DataManager.Instance.GetDataSo<DrinkDataAsset>().TryGetDataById(recipeResult, out var drink)
RecipeType.DrinkRecipe => DataManager.Instance.GetDataAsset<DrinkDataAsset>().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<ItemDataAsset>();
var itemSo = DataManager.Instance.GetDataAsset<ItemDataAsset>();
if (!itemSo.TryGetDataById(itemId, out var itemData)) return null;
if (InventoryManager.Instance.GetItemDataByIdOrNull(itemId) == null) return null;

View File

@ -252,7 +252,7 @@ public void CreateInventoryItemSlot(Transform parent)
}
else
{
if (DataManager.Instance.GetDataSo<CookwareDataAsset>().TryGetDataById(model.Id, out var cookwareData))
if (DataManager.Instance.GetDataAsset<CookwareDataAsset>().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<RecipeDataAsset>()
return DataManager.Instance.GetDataAsset<RecipeDataAsset>()
.TryGetDataById(model.Id, out var foodRecipe) && foodRecipe.RecipeType == RecipeType.FoodRecipe;
case InventoryCategoryType.Drink:
if (model.ItemType != ItemType.Recipe) return false;
return DataManager.Instance.GetDataSo<RecipeDataAsset>()
return DataManager.Instance.GetDataAsset<RecipeDataAsset>()
.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<CookwareDataAsset>()
return DataManager.Instance.GetDataAsset<CookwareDataAsset>()
.TryGetDataById(model.Id, out var cookwareData);
case InventoryCategoryType.Special:
return false;