구글 시트 로직 수정 (클래스명 변경)
This commit is contained in:
parent
bf1fe51957
commit
ba5d3ffb59
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
public class DataSo<T> : ScriptableObject where T : IId
|
public class DataAsset<T> : ScriptableObject where T : IId
|
||||||
{
|
{
|
||||||
[FormerlySerializedAs("Datas")] [SerializeField] protected List<T> _datas = new();
|
[FormerlySerializedAs("Datas")] [SerializeField] protected List<T> _datas = new();
|
||||||
|
|
@ -18,6 +18,6 @@ public InventoryItemData(string id, int quantity)
|
|||||||
Quantity = quantity;
|
Quantity = quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemData ItemData => InventoryManager.Instance.GetItemDataByIdOrNull(Id);
|
public ItemDataEntry ItemDataEntry => InventoryManager.Instance.GetItemDataByIdOrNull(Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,7 +19,7 @@ public class InventoryManager : Singleton<InventoryManager>, IManager
|
|||||||
{
|
{
|
||||||
[Title("아이템 전체 목록")]
|
[Title("아이템 전체 목록")]
|
||||||
[ShowInInspector, ReadOnly]
|
[ShowInInspector, ReadOnly]
|
||||||
private Dictionary<string, ItemData> _allItemDataLookup;
|
private Dictionary<string, ItemDataEntry> _allItemDataLookup;
|
||||||
|
|
||||||
[Title("아이템 보유 목록")]
|
[Title("아이템 보유 목록")]
|
||||||
[ShowInInspector, ReadOnly]
|
[ShowInInspector, ReadOnly]
|
||||||
@ -48,7 +48,7 @@ public void PostInit()
|
|||||||
|
|
||||||
private void InitializeItemData()
|
private void InitializeItemData()
|
||||||
{
|
{
|
||||||
var itemDataSo = DataManager.Instance.GetDataSo<ItemDataSo>();
|
var itemDataSo = DataManager.Instance.GetDataSo<ItemDataAsset>();
|
||||||
Debug.Assert(itemDataSo != null, "itemDataSo != null");
|
Debug.Assert(itemDataSo != null, "itemDataSo != null");
|
||||||
|
|
||||||
_allItemDataLookup = itemDataSo.GetDataList()
|
_allItemDataLookup = itemDataSo.GetDataList()
|
||||||
@ -129,12 +129,12 @@ public bool RemoveItem(string id, int quantity = 1)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadOnlyDictionary<string, ItemData> AllItemDataLookup => _allItemDataLookup;
|
public IReadOnlyDictionary<string, ItemDataEntry> AllItemDataLookup => _allItemDataLookup;
|
||||||
public IReadOnlyDictionary<string, InventoryItemData> InventoryItems => _inventoryItemDatas;
|
public IReadOnlyDictionary<string, InventoryItemData> InventoryItems => _inventoryItemDatas;
|
||||||
public bool ContainInventoryItem(string id) => _inventoryItemDatas.ContainsKey(id);
|
public bool ContainInventoryItem(string id) => _inventoryItemDatas.ContainsKey(id);
|
||||||
public bool TryGetInventoryItemData(string id, out InventoryItemData inventoryItemData) => _inventoryItemDatas.TryGetValue(id, out inventoryItemData);
|
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 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);
|
_allItemDataLookup.TryGetValue(id, out var itemData);
|
||||||
return itemData;
|
return itemData;
|
||||||
|
@ -28,14 +28,14 @@ private IEnumerable<string> GetAllItemIds()
|
|||||||
.Select(d => d.Id);
|
.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;
|
if (guids.Length == 0) return null;
|
||||||
|
|
||||||
string path = AssetDatabase.GUIDToAssetPath(guids[0]);
|
string path = AssetDatabase.GUIDToAssetPath(guids[0]);
|
||||||
return AssetDatabase.LoadAssetAtPath<ItemDataSo>(path);
|
return AssetDatabase.LoadAssetAtPath<ItemDataAsset>(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,10 +47,10 @@ private void RemoveItem()
|
|||||||
|
|
||||||
private IEnumerable<string> GetItemIds()
|
private IEnumerable<string> GetItemIds()
|
||||||
{
|
{
|
||||||
if (!Application.isPlaying || DataManager.Instance?.GetDataSo<ItemDataSo>() == null)
|
if (!Application.isPlaying || DataManager.Instance?.GetDataSo<ItemDataAsset>() == null)
|
||||||
return Enumerable.Empty<string>();
|
return Enumerable.Empty<string>();
|
||||||
|
|
||||||
return DataManager.Instance.GetDataSo<ItemDataSo>().GetDataList()
|
return DataManager.Instance.GetDataSo<ItemDataAsset>().GetDataList()
|
||||||
.Select(data => data.Id)
|
.Select(data => data.Id)
|
||||||
.Where(id => !string.IsNullOrEmpty(id));
|
.Where(id => !string.IsNullOrEmpty(id));
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ private object GetPropertyValue(string propertyPath)
|
|||||||
{
|
{
|
||||||
if (_dataContext == null) return null;
|
if (_dataContext == null) return null;
|
||||||
|
|
||||||
// 중첩 속성 지원 (예: "ItemData.Name")
|
// 중첩 속성 지원 (예: "ItemDataEntry.Name")
|
||||||
var properties = propertyPath.Split('.');
|
var properties = propertyPath.Split('.');
|
||||||
object current = _dataContext;
|
object current = _dataContext;
|
||||||
|
|
||||||
|
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CookwareDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CookwareDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerPoolDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/CustomerPoolDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/DrinkDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/DrinkDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/EnvironmentDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/EnvironmentDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/FoodDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/FoodDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/IngredientDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/IngredientDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/ItemDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/ItemDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/LevelDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/LevelDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/RecipeDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/RecipeDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/TasteDataAsset.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Assets/TasteDataAsset.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,23 @@
|
|||||||
|
// <auto-generated> File: CookwareDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "CookwareDataAsset", menuName = "GoogleSheet/CookwareDataAsset")]
|
||||||
|
public class CookwareDataAsset : DataAsset<CookwareDataEntry>
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ public enum CookwareType
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class CookwareData : IId
|
public class CookwareDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별ID</summary>
|
/// <summary>식별ID</summary>
|
||||||
[Tooltip("식별ID")]
|
[Tooltip("식별ID")]
|
@ -1,23 +0,0 @@
|
|||||||
// <auto-generated> File: CookwareDataSo.cs
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "CookwareDataSo", menuName = "GoogleSheet/CookwareDataSo")]
|
|
||||||
public class CookwareDataSo : DataSo<CookwareData>
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
[CreateAssetMenu(fileName = "CustomerDataSo", menuName = "GoogleSheet/CustomerDataSo")]
|
[CreateAssetMenu(fileName = "CustomerDataAsset", menuName = "GoogleSheet/CustomerDataAsset")]
|
||||||
public class CustomerDataSo : DataSo<CustomerData>
|
public class CustomerDataAsset : DataAsset<CustomerDataEntry>
|
||||||
{
|
{
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
@ -15,7 +15,7 @@ public enum CustomerType
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class CustomerData : IId
|
public class CustomerDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별번호</summary>
|
/// <summary>식별번호</summary>
|
||||||
[Tooltip("식별번호")]
|
[Tooltip("식별번호")]
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
[CreateAssetMenu(fileName = "CustomerPoolDataSo", menuName = "GoogleSheet/CustomerPoolDataSo")]
|
[CreateAssetMenu(fileName = "CustomerPoolDataAsset", menuName = "GoogleSheet/CustomerPoolDataAsset")]
|
||||||
public class CustomerPoolDataSo : DataSo<CustomerPoolData>
|
public class CustomerPoolDataAsset : DataAsset<CustomerPoolDataEntry>
|
||||||
{
|
{
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
@ -7,7 +7,7 @@
|
|||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class CustomerPoolData : IId
|
public class CustomerPoolDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별번호</summary>
|
/// <summary>식별번호</summary>
|
||||||
[Tooltip("식별번호")]
|
[Tooltip("식별번호")]
|
@ -0,0 +1,9 @@
|
|||||||
|
// <auto-generated> File: DrinkDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "DrinkDataAsset", menuName = "GoogleSheet/DrinkDataAsset")]
|
||||||
|
public class DrinkDataAsset : DataAsset<DrinkDataEntry> { }
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class FoodData : IId
|
public class DrinkDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별ID</summary>
|
/// <summary>식별ID</summary>
|
||||||
[Tooltip("식별ID")]
|
[Tooltip("식별ID")]
|
@ -1,9 +0,0 @@
|
|||||||
// <auto-generated> File: DrinkDataSo.cs
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "DrinkDataSo", menuName = "GoogleSheet/DrinkDataSo")]
|
|
||||||
public class DrinkDataSo : DataSo<DrinkData> { }
|
|
||||||
}
|
|
@ -0,0 +1,9 @@
|
|||||||
|
// <auto-generated> File: EnvironmentDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "EnvironmentDataAsset", menuName = "GoogleSheet/EnvironmentDataAsset")]
|
||||||
|
public class EnvironmentDataAsset : DataAsset<EnvironmentDataEntry> { }
|
||||||
|
}
|
@ -12,7 +12,7 @@ public enum RendererType
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class EnvironmentData : IId
|
public class EnvironmentDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별번호</summary>
|
/// <summary>식별번호</summary>
|
||||||
[Tooltip("식별번호")]
|
[Tooltip("식별번호")]
|
@ -1,9 +0,0 @@
|
|||||||
// <auto-generated> File: EnvironmentDataSo.cs
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "EnvironmentDataSo", menuName = "GoogleSheet/EnvironmentDataSo")]
|
|
||||||
public class EnvironmentDataSo : DataSo<EnvironmentData> { }
|
|
||||||
}
|
|
@ -0,0 +1,9 @@
|
|||||||
|
// <auto-generated> File: FoodDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "FoodDataAsset", menuName = "GoogleSheet/FoodDataAsset")]
|
||||||
|
public class FoodDataAsset : DataAsset<FoodDataEntry> { }
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class DrinkData : IId
|
public class FoodDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별ID</summary>
|
/// <summary>식별ID</summary>
|
||||||
[Tooltip("식별ID")]
|
[Tooltip("식별ID")]
|
@ -1,9 +0,0 @@
|
|||||||
// <auto-generated> File: FoodDataSo.cs
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "FoodDataSo", menuName = "GoogleSheet/FoodDataSo")]
|
|
||||||
public class FoodDataSo : DataSo<FoodData> { }
|
|
||||||
}
|
|
@ -0,0 +1,8 @@
|
|||||||
|
// <auto-generated>
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "IngredientDataAsset", menuName = "GoogleSheet/IngredientDataAsset")]
|
||||||
|
public class IngredientDataAsset : DataAsset<IngredientDataEntry> { }
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class IngredientData : IId
|
public class IngredientDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별ID</summary>
|
/// <summary>식별ID</summary>
|
||||||
[Tooltip("식별ID")]
|
[Tooltip("식별ID")]
|
@ -1,8 +0,0 @@
|
|||||||
// <auto-generated>
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "IngredientDataSo", menuName = "GoogleSheet/IngredientDataSo")]
|
|
||||||
public class IngredientDataSo : DataSo<IngredientData> { }
|
|
||||||
}
|
|
@ -0,0 +1,9 @@
|
|||||||
|
// <auto-generated> File: ItemDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "ItemDataAsset", menuName = "GoogleSheet/ItemDataAsset")]
|
||||||
|
public class ItemDataAsset : DataAsset<ItemDataEntry> { }
|
||||||
|
}
|
@ -15,7 +15,7 @@ public enum ItemType
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemData : IId
|
public class ItemDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별번호</summary>
|
/// <summary>식별번호</summary>
|
||||||
[Tooltip("식별번호")]
|
[Tooltip("식별번호")]
|
@ -1,9 +0,0 @@
|
|||||||
// <auto-generated> File: ItemDataSo.cs
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "ItemDataSo", menuName = "GoogleSheet/ItemDataSo")]
|
|
||||||
public class ItemDataSo : DataSo<ItemData> { }
|
|
||||||
}
|
|
@ -0,0 +1,8 @@
|
|||||||
|
// <auto-generated>
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "LevelDataAsset", menuName = "GoogleSheet/LevelDataAsset")]
|
||||||
|
public class LevelDataAsset : DataAsset<LevelDataEntry> { }
|
||||||
|
}
|
@ -12,7 +12,7 @@ public enum SpawnType
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class LevelData : IId
|
public class LevelDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별번호</summary>
|
/// <summary>식별번호</summary>
|
||||||
[Tooltip("식별번호")]
|
[Tooltip("식별번호")]
|
@ -1,8 +0,0 @@
|
|||||||
// <auto-generated>
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "LevelDataSo", menuName = "GoogleSheet/LevelDataSo")]
|
|
||||||
public class LevelDataSo : DataSo<LevelData> { }
|
|
||||||
}
|
|
@ -0,0 +1,9 @@
|
|||||||
|
// <auto-generated> File: RecipeDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "RecipeDataAsset", menuName = "GoogleSheet/RecipeDataAsset")]
|
||||||
|
public class RecipeDataAsset : DataAsset<RecipeDataEntry> { }
|
||||||
|
}
|
@ -12,7 +12,7 @@ public enum RecipeType
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class RecipeData : IId
|
public class RecipeDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별ID</summary>
|
/// <summary>식별ID</summary>
|
||||||
[Tooltip("식별ID")]
|
[Tooltip("식별ID")]
|
@ -1,9 +0,0 @@
|
|||||||
// <auto-generated> File: RecipeDataSo.cs
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "RecipeDataSo", menuName = "GoogleSheet/RecipeDataSo")]
|
|
||||||
public class RecipeDataSo : DataSo<RecipeData> { }
|
|
||||||
}
|
|
@ -0,0 +1,9 @@
|
|||||||
|
// <auto-generated> File: TasteDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "TasteDataAsset", menuName = "GoogleSheet/TasteDataAsset")]
|
||||||
|
public class TasteDataAsset : DataAsset<TasteDataEntry> { }
|
||||||
|
}
|
@ -28,7 +28,7 @@ public enum TasteType
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class TasteData : IId
|
public class TasteDataEntry : IId
|
||||||
{
|
{
|
||||||
/// <summary>식별ID</summary>
|
/// <summary>식별ID</summary>
|
||||||
[Tooltip("식별ID")]
|
[Tooltip("식별ID")]
|
@ -1,9 +0,0 @@
|
|||||||
// <auto-generated> File: TasteDataSo.cs
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
|
||||||
{
|
|
||||||
[CreateAssetMenu(fileName = "TasteDataSo", menuName = "GoogleSheet/TasteDataSo")]
|
|
||||||
public class TasteDataSo : DataSo<TasteData> { }
|
|
||||||
}
|
|
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CookwareDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CookwareDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/DrinkDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/DrinkDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/EnvironmentDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/EnvironmentDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/FoodDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/FoodDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/IngredientDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/IngredientDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/ItemDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/ItemDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/RecipeDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/RecipeDataSo.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/TasteDataSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/TasteDataSo.asset
(Stored with Git LFS)
Binary file not shown.
@ -83,8 +83,8 @@ public CodeGenerationResult Generate(string fullJson, IReadOnlyCollection<string
|
|||||||
if (!autoCreateSheets.Contains(className)) continue;
|
if (!autoCreateSheets.Contains(className)) continue;
|
||||||
if (pair.Value is not JArray items || items.Count < 2) continue;
|
if (pair.Value is not JArray items || items.Count < 2) continue;
|
||||||
|
|
||||||
string dataAssetPath = $"{classesFolderAssetPath}/{className}.cs";
|
string dataAssetPath = $"{classesFolderAssetPath}/{className}Entry.cs";
|
||||||
string soAssetPath = $"{classesFolderAssetPath}/{className}So.cs";
|
string soAssetPath = $"{classesFolderAssetPath}/{className}Asset.cs";
|
||||||
|
|
||||||
if (!File.Exists(GoogleSheetSettingsSo.AssetToFull(dataAssetPath)))
|
if (!File.Exists(GoogleSheetSettingsSo.AssetToFull(dataAssetPath)))
|
||||||
{
|
{
|
||||||
@ -173,8 +173,8 @@ private string GenerateSoClass(string rootNamespace, string className)
|
|||||||
|
|
||||||
namespace {rootNamespace}
|
namespace {rootNamespace}
|
||||||
{{
|
{{
|
||||||
[CreateAssetMenu(fileName = ""{safe}So"", menuName = ""GoogleSheet/{safe}So"")]
|
[CreateAssetMenu(fileName = ""{safe}Asset"", menuName = ""GoogleSheet/{safe}Asset"")]
|
||||||
public class {safe}So : DataSo<{safe}> {{ }}
|
public class {safe}Asset : DataAsset<{safe}> {{ }}
|
||||||
}}";
|
}}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ private string GenerateDataClass(string rootNamespace, string className, JArray
|
|||||||
sb.AppendLine($"namespace {rootNamespace}");
|
sb.AppendLine($"namespace {rootNamespace}");
|
||||||
sb.AppendLine("{");
|
sb.AppendLine("{");
|
||||||
sb.AppendLine(" [Serializable]");
|
sb.AppendLine(" [Serializable]");
|
||||||
sb.AppendLine($" public class {safeClass} : IId");
|
sb.AppendLine($" public class {safeClass}Entry : IId");
|
||||||
sb.AppendLine(" {");
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
foreach (var prop in sampleRow.Properties())
|
foreach (var prop in sampleRow.Properties())
|
||||||
|
@ -21,7 +21,7 @@ public class GoogleSheetSettingsSo : ScriptableObject
|
|||||||
[Header("출력 경로(모두 AssetPath, 한 곳만 바꾸면 연동)")]
|
[Header("출력 경로(모두 AssetPath, 한 곳만 바꾸면 연동)")]
|
||||||
[SerializeField] private string _generateAssetBasePath = "Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated";
|
[SerializeField] private string _generateAssetBasePath = "Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated";
|
||||||
[SerializeField] private string _classesFolderName = "Classes";
|
[SerializeField] private string _classesFolderName = "Classes";
|
||||||
[SerializeField] private string _soFolderName = "So";
|
[SerializeField] private string _assetFolderName = "Assets";
|
||||||
[SerializeField] private string _logsFolderName = "Logs";
|
[SerializeField] private string _logsFolderName = "Logs";
|
||||||
[SerializeField] private string _backupsFolderName = "BackUps";
|
[SerializeField] private string _backupsFolderName = "BackUps";
|
||||||
[SerializeField] private string _enumTypesFileName = "EnumTypes.cs";
|
[SerializeField] private string _enumTypesFileName = "EnumTypes.cs";
|
||||||
@ -30,7 +30,7 @@ public class GoogleSheetSettingsSo : ScriptableObject
|
|||||||
|
|
||||||
public string GenerateAssetBasePath => _generateAssetBasePath;
|
public string GenerateAssetBasePath => _generateAssetBasePath;
|
||||||
public string ClassesFolderAssetPath => CombineAsset(_generateAssetBasePath, _classesFolderName);
|
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 LogsFolderAssetPath => CombineAsset(_generateAssetBasePath, _logsFolderName);
|
||||||
public string BackupsFolderAssetPath => CombineAsset(_generateAssetBasePath, _backupsFolderName);
|
public string BackupsFolderAssetPath => CombineAsset(_generateAssetBasePath, _backupsFolderName);
|
||||||
public string EnumTypesAssetPath => CombineAsset(_generateAssetBasePath, _enumTypesFileName);
|
public string EnumTypesAssetPath => CombineAsset(_generateAssetBasePath, _enumTypesFileName);
|
||||||
@ -74,7 +74,7 @@ private void OnValidate()
|
|||||||
{
|
{
|
||||||
_generateAssetBasePath = NormalizeAssetPath(_generateAssetBasePath);
|
_generateAssetBasePath = NormalizeAssetPath(_generateAssetBasePath);
|
||||||
_classesFolderName = (_classesFolderName ?? "Classes").Replace("/", "").Replace("\\", "");
|
_classesFolderName = (_classesFolderName ?? "Classes").Replace("/", "").Replace("\\", "");
|
||||||
_soFolderName = (_soFolderName ?? "So").Replace("/", "").Replace("\\", "");
|
_assetFolderName = (_assetFolderName ?? "So").Replace("/", "").Replace("\\", "");
|
||||||
_logsFolderName = (_logsFolderName ?? "Logs").Replace("/", "").Replace("\\", "");
|
_logsFolderName = (_logsFolderName ?? "Logs").Replace("/", "").Replace("\\", "");
|
||||||
_backupsFolderName = (_backupsFolderName ?? "BackUps").Replace("/", "").Replace("\\", "");
|
_backupsFolderName = (_backupsFolderName ?? "BackUps").Replace("/", "").Replace("\\", "");
|
||||||
_enumTypesFileName = string.IsNullOrWhiteSpace(_enumTypesFileName) ? "EnumTypes.cs" : _enumTypesFileName;
|
_enumTypesFileName = string.IsNullOrWhiteSpace(_enumTypesFileName) ? "EnumTypes.cs" : _enumTypesFileName;
|
||||||
|
@ -20,11 +20,11 @@ private void Awake()
|
|||||||
_blackboardComponent = GetComponent<CustomerBlackboardComponent>();
|
_blackboardComponent = GetComponent<CustomerBlackboardComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task InitializeAi(CustomerData inCustomerData)
|
public async Task InitializeAi(CustomerDataEntry inCustomerDataEntry)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await InitializeAiInternal(inCustomerData);
|
await InitializeAiInternal(inCustomerDataEntry);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@ -34,21 +34,21 @@ public async Task InitializeAi(CustomerData inCustomerData)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task InitializeAiInternal(CustomerData inCustomerData)
|
private async Task InitializeAiInternal(CustomerDataEntry inCustomerDataEntry)
|
||||||
{
|
{
|
||||||
var customerState = RestaurantState.Instance.CustomerState;
|
var customerState = RestaurantState.Instance.CustomerState;
|
||||||
var subtree = customerState.GetLoadedSubtree(inCustomerData.CustomerType);
|
var subtree = customerState.GetLoadedSubtree(inCustomerDataEntry.CustomerType);
|
||||||
|
|
||||||
if (subtree == null)
|
if (subtree == null)
|
||||||
{
|
{
|
||||||
Debug.LogError(
|
Debug.LogError(
|
||||||
$"[CustomerCharacter] No preloaded subtree found for CustomerType: {inCustomerData.CustomerType}. Make sure CustomerBehaviorData is loaded.");
|
$"[CustomerCharacter] No preloaded subtree found for CustomerType: {inCustomerDataEntry.CustomerType}. Make sure CustomerBehaviorData is loaded.");
|
||||||
subtree = await customerState.GetOrLoadSubtree(inCustomerData.CustomerType);
|
subtree = await customerState.GetOrLoadSubtree(inCustomerDataEntry.CustomerType);
|
||||||
}
|
}
|
||||||
|
|
||||||
_behaviorTree.Subgraph = subtree;
|
_behaviorTree.Subgraph = subtree;
|
||||||
_blackboardComponent.InitializeWithBehaviorTree(subtree);
|
_blackboardComponent.InitializeWithBehaviorTree(subtree);
|
||||||
_blackboardComponent.SetCustomerData(inCustomerData);
|
_blackboardComponent.SetCustomerData(inCustomerDataEntry);
|
||||||
// TODO : 1. Subtree - Action, Condition
|
// TODO : 1. Subtree - Action, Condition
|
||||||
// TODO : 2. Blackboard
|
// TODO : 2. Blackboard
|
||||||
_behaviorTree.StartBehavior();
|
_behaviorTree.StartBehavior();
|
||||||
|
@ -17,10 +17,10 @@ public void InitializeWithBehaviorTree(Subtree subtree)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCustomerData(CustomerData inCustomerData)
|
public void SetCustomerData(CustomerDataEntry inCustomerDataEntry)
|
||||||
{
|
{
|
||||||
if (_subtree == null) return;
|
if (_subtree == null) return;
|
||||||
_subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerData);
|
_subtree.SetVariableValue(nameof(RestaurantCustomerBlackboardKey.CustomerData), inCustomerDataEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCurrentInteractionTarget(GameObject targetGameObject)
|
public void SetCurrentInteractionTarget(GameObject targetGameObject)
|
||||||
|
@ -4,6 +4,6 @@ namespace DDD
|
|||||||
{
|
{
|
||||||
public interface ICustomerAi
|
public interface ICustomerAi
|
||||||
{
|
{
|
||||||
Task InitializeAi(CustomerData inCustomerData);
|
Task InitializeAi(CustomerDataEntry inCustomerDataEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,7 +11,7 @@ public enum RestaurantCustomerBlackboardKey
|
|||||||
|
|
||||||
public interface ICustomerBlackboard
|
public interface ICustomerBlackboard
|
||||||
{
|
{
|
||||||
void SetCustomerData(CustomerData inCustomerData);
|
void SetCustomerData(CustomerDataEntry inCustomerDataEntry);
|
||||||
void SetCurrentInteractionTarget(GameObject targetGameObject);
|
void SetCurrentInteractionTarget(GameObject targetGameObject);
|
||||||
GameObject GetCurrentInteractionTarget();
|
GameObject GetCurrentInteractionTarget();
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user