兄弟会話をScriptDataロード仕様に変更

This commit is contained in:
kimura 2021-10-14 12:48:38 +09:00
parent c47ccf1e4f
commit c32eb0bf7c
2 changed files with 8 additions and 5 deletions

View File

@ -8,6 +8,7 @@ using UnityEngine.UI;
public class BrotherConversation : MonoBehaviour
{
public static readonly string ScriptDataTag = "BrotherConversationScriptData";
private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger");
private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger");
@ -25,10 +26,7 @@ public class BrotherConversation : MonoBehaviour
private void Start()
{
// レベルからスクリプト読み込み
var level = 2;
var scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.ScriptDataSheet);
var targetScriptList = scriptList.Where(data => data.id == level).ToList();
var targetScriptList = LocalCacheManager.Load<List<BrotherScriptData>>(ScriptDataTag);
var clickCountStream = this.UpdateAsObservable()
.Select(_ => Input.GetMouseButton(0))

View File

@ -19,6 +19,12 @@ public class ShopLevelUp : MonoBehaviour
private void Start()
{
// レベルからスクリプト読み込み
var shopLevel = 5;
var scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.ScriptDataSheet);
var targetScriptList = scriptList.Where(data => data.id == shopLevel).ToList();
LocalCacheManager.Save(BrotherConversation.ScriptDataTag, targetScriptList);
closeButton.OnClickAsObservable().Subscribe(_ =>
{
transform.SetLocalScale(0);
@ -32,7 +38,6 @@ public class ShopLevelUp : MonoBehaviour
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
var shopLevelList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopLevelData>(Const.ShopLevelDataSheet);
var shopLevel = 5;
shopLevelText.text = shopLevel.ToString();
achievementText.text = shopLevelList.First(data => data.shopLevel == shopLevel).achievement;
recipeNameText.text = productList.First(data => data.shopLevel == shopLevel).name;