구글 시트 데이터 최신화
This commit is contained in:
parent
fad3ba39c8
commit
4dd450ea32
@ -34,7 +34,7 @@ Material:
|
|||||||
m_LightmapFlags: 2
|
m_LightmapFlags: 2
|
||||||
m_EnableInstancingVariants: 0
|
m_EnableInstancingVariants: 0
|
||||||
m_DoubleSidedGI: 0
|
m_DoubleSidedGI: 0
|
||||||
m_CustomRenderQueue: -1
|
m_CustomRenderQueue: 2450
|
||||||
stringTagMap:
|
stringTagMap:
|
||||||
RenderType: TransparentCutout
|
RenderType: TransparentCutout
|
||||||
disabledShaderPasses:
|
disabledShaderPasses:
|
||||||
@ -47,6 +47,10 @@ Material:
|
|||||||
m_Texture: {fileID: 2800000, guid: 9e3e41f5375f0477ea843b5f6aff3e9c, type: 3}
|
m_Texture: {fileID: 2800000, guid: 9e3e41f5375f0477ea843b5f6aff3e9c, type: 3}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _BaseMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
- _Emiss:
|
- _Emiss:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
@ -59,6 +63,10 @@ Material:
|
|||||||
m_Texture: {fileID: 2800000, guid: 5065b680750834465b52cebe19f5b46e, type: 3}
|
m_Texture: {fileID: 2800000, guid: 5065b680750834465b52cebe19f5b46e, type: 3}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
m_Offset: {x: 0, y: 0}
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _OpacityMap:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
- unity_Lightmaps:
|
- unity_Lightmaps:
|
||||||
m_Texture: {fileID: 0}
|
m_Texture: {fileID: 0}
|
||||||
m_Scale: {x: 1, y: 1}
|
m_Scale: {x: 1, y: 1}
|
||||||
@ -97,6 +105,7 @@ Material:
|
|||||||
- _Smoothness: 0.5
|
- _Smoothness: 0.5
|
||||||
- _SrcBlend: 1
|
- _SrcBlend: 1
|
||||||
- _Surface: 0
|
- _Surface: 0
|
||||||
|
- _UseOpacityMask: 0
|
||||||
- _WorkflowMode: 1
|
- _WorkflowMode: 1
|
||||||
- _ZTest: 4
|
- _ZTest: 4
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
|
BIN
Assets/_DDD/_ScriptAssets/So/GoogleSheetManager.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_ScriptAssets/So/GoogleSheetManager.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/_DDD/_ScriptAssets/So/GoogleSheetSettingsSo.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_ScriptAssets/So/GoogleSheetSettingsSo.asset
(Stored with Git LFS)
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 21d0d76d7f889ce45b40db20dddf3851
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 50c2a4b526b61864083332f609fde611
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,35 @@
|
|||||||
|
// <auto-generated>
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
public enum CustomerType
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Normal,
|
||||||
|
Special
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class CustomerData : IId
|
||||||
|
{
|
||||||
|
/// <summary>식별번호</summary>
|
||||||
|
[Tooltip("식별번호")]
|
||||||
|
[field: SerializeField]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>손님 타입</summary>
|
||||||
|
[Tooltip("손님 타입")]
|
||||||
|
public CustomerType CustomerType;
|
||||||
|
|
||||||
|
/// <summary>스파인 스킨 키 값</summary>
|
||||||
|
[Tooltip("스파인 스킨 키 값")]
|
||||||
|
public string SpineSkinKey;
|
||||||
|
|
||||||
|
/// <summary>선호 맛들</summary>
|
||||||
|
[Tooltip("선호 맛들")]
|
||||||
|
public string FavoriteTastes;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 24a354acd91b9d944aeb01375a9e9c4e
|
@ -0,0 +1,8 @@
|
|||||||
|
// <auto-generated>
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "CustomerDataSo", menuName = "GoogleSheet/CustomerDataSo")]
|
||||||
|
public class CustomerDataSo : DataSo<CustomerData> { }
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 090ee4c808412044090f3281830e08f6
|
@ -0,0 +1,24 @@
|
|||||||
|
// <auto-generated>
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class CustomerPoolData : IId
|
||||||
|
{
|
||||||
|
/// <summary>식별번호</summary>
|
||||||
|
[Tooltip("식별번호")]
|
||||||
|
[field: SerializeField]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>손님 최대 수</summary>
|
||||||
|
[Tooltip("손님 최대 수")]
|
||||||
|
public int CustomerLimitCount;
|
||||||
|
|
||||||
|
/// <summary>등장 손님들</summary>
|
||||||
|
[Tooltip("등장 손님들")]
|
||||||
|
public string Customers;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9bad451e3ceb644459533d83a8144378
|
@ -0,0 +1,8 @@
|
|||||||
|
// <auto-generated>
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "CustomerPoolDataSo", menuName = "GoogleSheet/CustomerPoolDataSo")]
|
||||||
|
public class CustomerPoolDataSo : DataSo<CustomerPoolData> { }
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8c31b1b5bf70f3f4e80ff11973c8eb8c
|
File diff suppressed because it is too large
Load Diff
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Logs/GoogleSheetChangeLog.asset
(Stored with Git LFS)
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/Logs/GoogleSheetChangeLog.asset
(Stored with Git LFS)
Binary file not shown.
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)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerDataSo.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 63f18758dde45c349bf1eb84a6b2b507
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/CustomerPoolDataSo.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b2607a9819d236b418d2280c56fd3e62
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
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/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)
Normal file
BIN
Assets/_DDD/_Scripts/GenerateGoogleSheet/AutoCreated/So/LevelDataSo.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3392661ff91138a4991ec360e86907cb
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
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.
@ -23,8 +23,9 @@ public class GoogleSheetManager : ScriptableObject
|
|||||||
[LabelText("선택 버전"), ValueDropdown(nameof(GetVersionOptions))]
|
[LabelText("선택 버전"), ValueDropdown(nameof(GetVersionOptions))]
|
||||||
[SerializeField] private int _selectedVersionIndex;
|
[SerializeField] private int _selectedVersionIndex;
|
||||||
|
|
||||||
|
[SerializeField] private bool _isBusy;
|
||||||
|
|
||||||
private string _lastJsonCache;
|
private string _lastJsonCache;
|
||||||
private bool _isBusy;
|
|
||||||
|
|
||||||
private IGoogleSheetSource _source;
|
private IGoogleSheetSource _source;
|
||||||
private IJsonDiffer _differ;
|
private IJsonDiffer _differ;
|
||||||
@ -306,7 +307,7 @@ private int GetSnapshotCountSafe()
|
|||||||
return (log != null && log.Logs != null) ? log.Logs.Count : 0;
|
return (log != null && log.Logs != null) ? log.Logs.Count : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> GuardAsync(Func<Task> body, string tag)
|
private async Task<bool> GuardAsync(Func<Task> body, string tag, int timeoutMs = 90000)
|
||||||
{
|
{
|
||||||
if (_isBusy)
|
if (_isBusy)
|
||||||
{
|
{
|
||||||
@ -317,9 +318,21 @@ private async Task<bool> GuardAsync(Func<Task> body, string tag)
|
|||||||
_isBusy = true;
|
_isBusy = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await body();
|
// 본문과 타임아웃 중 먼저 끝나는 쪽을 기다린다
|
||||||
|
var work = body();
|
||||||
|
var done = await Task.WhenAny(work, Task.Delay(timeoutMs));
|
||||||
|
if (done != work)
|
||||||
|
throw new TimeoutException($"[{tag}] {timeoutMs}ms 타임아웃");
|
||||||
|
|
||||||
|
// body() 내부 예외 전파
|
||||||
|
await work;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"[{tag}] 취소됨");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.LogError($"[{tag}] 실행 중 예외: {e}");
|
Debug.LogError($"[{tag}] 실행 중 예외: {e}");
|
||||||
@ -339,14 +352,23 @@ await GuardAsync(async () =>
|
|||||||
if (_settings == null) { Debug.LogError("Settings So가 없습니다."); return; }
|
if (_settings == null) { Debug.LogError("Settings So가 없습니다."); return; }
|
||||||
BuildServices();
|
BuildServices();
|
||||||
|
|
||||||
Debug.Log("[FetchJsonOnly] 시작");
|
Debug.Log("[FetchJsonOnly] 1) 시작");
|
||||||
var json = await _source.FetchAllJsonAsync();
|
var fetchTask = _source.FetchAllJsonAsync();
|
||||||
|
|
||||||
|
// 네트워크 대기를 한 번 더 보호 (HttpClient/UnityWebRequest가 내부 타임아웃 실패 시 대비)
|
||||||
|
var done = await Task.WhenAny(fetchTask, Task.Delay(_settings.HttpTimeoutSeconds * 2000));
|
||||||
|
if (done != fetchTask)
|
||||||
|
throw new TimeoutException("[FetchJsonOnly] 소스에서 응답 지연(추가 타임아웃)");
|
||||||
|
|
||||||
|
var json = await fetchTask;
|
||||||
|
Debug.Log($"[FetchJsonOnly] 2) 페치 완료 len={(json?.Length ?? 0)}");
|
||||||
if (string.IsNullOrWhiteSpace(json))
|
if (string.IsNullOrWhiteSpace(json))
|
||||||
{
|
{
|
||||||
Debug.LogWarning("[FetchJsonOnly] 가져온 JSON이 비어있습니다.");
|
Debug.LogWarning("[FetchJsonOnly] 가져온 JSON이 비어있습니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug.Log("[FetchJsonOnly] 3) 메인스레드에서 저장/임포트 예약");
|
||||||
await RunOnMainThread(() =>
|
await RunOnMainThread(() =>
|
||||||
{
|
{
|
||||||
var full = GoogleSheetSettingsSo.AssetToFull(_settings.JsonWorkFileAssetPath);
|
var full = GoogleSheetSettingsSo.AssetToFull(_settings.JsonWorkFileAssetPath);
|
||||||
@ -358,7 +380,7 @@ await RunOnMainThread(() =>
|
|||||||
AssetDatabase.ImportAsset(_settings.JsonWorkFileAssetPath);
|
AssetDatabase.ImportAsset(_settings.JsonWorkFileAssetPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
Debug.Log("[FetchJsonOnly] 완료");
|
Debug.Log("[FetchJsonOnly] 4) 완료");
|
||||||
}, tag: "FetchJsonOnly");
|
}, tag: "FetchJsonOnly");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user