Merge branch 'develop' of bitbucket.org:usaya/popcorn into develop
This commit is contained in:
commit
4e7161fa74
|
|
@ -785,7 +785,7 @@ RectTransform:
|
||||||
- {fileID: 308891213}
|
- {fileID: 308891213}
|
||||||
- {fileID: 698470367}
|
- {fileID: 698470367}
|
||||||
m_Father: {fileID: 2144327477}
|
m_Father: {fileID: 2144327477}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
|
@ -991,6 +991,80 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1720684618}
|
m_GameObject: {fileID: 1720684618}
|
||||||
m_CullTransparentMesh: 0
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!1 &1728771686
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1728771687}
|
||||||
|
- component: {fileID: 1728771689}
|
||||||
|
- component: {fileID: 1728771688}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: BG
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &1728771687
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1728771686}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 2144327477}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &1728771688
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1728771686}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 0}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!222 &1728771689
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1728771686}
|
||||||
|
m_CullTransparentMesh: 0
|
||||||
--- !u!1 &1848874147
|
--- !u!1 &1848874147
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1130,6 +1204,7 @@ RectTransform:
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||||
m_Children:
|
m_Children:
|
||||||
|
- {fileID: 1728771687}
|
||||||
- {fileID: 884928058}
|
- {fileID: 884928058}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ public class CornField : MonoBehaviour
|
||||||
[SerializeField] private Transform animationTarget;
|
[SerializeField] private Transform animationTarget;
|
||||||
[Space]
|
[Space]
|
||||||
[SerializeField] private List<PlantLine> plantLines = new List<PlantLine>();
|
[SerializeField] private List<PlantLine> plantLines = new List<PlantLine>();
|
||||||
private readonly List<PlantLine> availableLines = new List<PlantLine>();
|
|
||||||
private static readonly int maxPeriod = 60;
|
private static readonly int maxPeriod = 60;
|
||||||
private static readonly int minPeriod = 45;
|
private static readonly int minPeriod = 45;
|
||||||
private static readonly int harvestedFrameInterval = 3;
|
private static readonly int harvestedFrameInterval = 3;
|
||||||
|
|
@ -59,33 +58,19 @@ public class CornField : MonoBehaviour
|
||||||
counterView.Initialize(gameData.cornSeed);
|
counterView.Initialize(gameData.cornSeed);
|
||||||
SetData();
|
SetData();
|
||||||
|
|
||||||
var fieldData = SpreadsheetDataManager.Instance.GetBaseDataList<FieldUpgradeData>(Const.FieldUpgradeDataSheet);
|
|
||||||
|
|
||||||
// 畑リセット
|
// 畑リセット
|
||||||
foreach (var line in plantLines)
|
foreach (var line in plantLines)
|
||||||
{
|
{
|
||||||
line.gameObject.SetActive(false);
|
line.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// セーブデータから畑を復元
|
SetCornField();
|
||||||
availableLines.Clear();
|
|
||||||
foreach (var lineData in gameData.PlantLineDataList)
|
upgradeButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
var plantLine = plantLines.First(x => x.LineName == lineData.Type);
|
LocalCacheManager.Save(CornFieldReinforcement.CornFieldResetCallbackTag, new Action(SetCornField));
|
||||||
plantLine.gameObject.SetActive(true);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Reinforcement);
|
||||||
plantLine.SetFieldLevel(lineData.Level);
|
}).AddTo(this);
|
||||||
availableLines.Add(plantLine);
|
|
||||||
// コーン株の進行度初回データ作成
|
|
||||||
if (!gameData.SeedlingDataList.Exists(x => x.type == lineData.Type))
|
|
||||||
{
|
|
||||||
gameData.SeedlingDataList.Add(new SeedlingProgressData
|
|
||||||
{
|
|
||||||
type = lineData.Type,
|
|
||||||
Seedlings = Enumerable.Repeat(GenerateSeedlingGene(lineData.Level), plantLine.Seedlings.Count).ToList()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GameDataManager.SaveGameData();
|
|
||||||
|
|
||||||
// 収穫カウンター+吸収演出
|
// 収穫カウンター+吸収演出
|
||||||
cornHarvester.FinishHarvested
|
cornHarvester.FinishHarvested
|
||||||
|
|
@ -130,71 +115,101 @@ public class CornField : MonoBehaviour
|
||||||
counterView.SetHarvestedCount(x.count);
|
counterView.SetHarvestedCount(x.count);
|
||||||
});
|
});
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
// 株設定
|
}
|
||||||
foreach (var line in availableLines)
|
|
||||||
{
|
|
||||||
var seedlingDataIndex = gameData.SeedlingDataList.FindIndex(x => x.type == line.LineName);
|
|
||||||
var lineData = gameData.SeedlingDataList[seedlingDataIndex];
|
|
||||||
var i = 0;
|
|
||||||
foreach (var seedling in line.Seedlings)
|
|
||||||
{
|
|
||||||
var index = i;
|
|
||||||
i++;
|
|
||||||
seedling.SetSeedlingGene(lineData.Seedlings[index].FirstTime, lineData.Seedlings[index].Period, lineData.Seedlings[index].Level);
|
|
||||||
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
|
||||||
if (UsayaStorageManager.LoadOrDefault(UsayaStorageFilename.Settings_Data, "DebugFastGrowing", false))
|
|
||||||
{
|
|
||||||
seedling.SetSeedlingGene(lineData.Seedlings[index].FirstTime, lineData.Seedlings[index].Period / 3, lineData.Seedlings[index].Level);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// 収穫通知
|
|
||||||
seedling.Harvested.Subscribe(_ =>
|
|
||||||
{
|
|
||||||
VibrationManager.Instance.PlayVibrationOnce();
|
|
||||||
var harvestCount = fieldData.FirstOrDefault(x => x.Type == CornFieldUpgradeType.FieldCenter && x.level == (int)lineData.Seedlings[index].Level)?.harvested ?? 1;
|
|
||||||
var harvestedCorn = fieldData.FirstOrDefault(x => x.Type == CornFieldUpgradeType.Machine && x.level == gameData.MachineLevel)?.harvested ?? 20;
|
|
||||||
gameData.cornSeed += harvestedCorn * harvestCount;
|
|
||||||
var seedlingTransform = seedling.transform;
|
|
||||||
|
|
||||||
var harvestEffect = Instantiate(harvestEffectPrefab, seedlingTransform);
|
public void SetCornField()
|
||||||
Destroy(harvestEffect, 1f);
|
{
|
||||||
for (int j = 0; j < harvestCount; j++)
|
compositeDisposable.Clear();
|
||||||
{
|
var gameData = GameDataManager.GameData;
|
||||||
// 株の位置調整
|
var fieldData = SpreadsheetDataManager.Instance.GetBaseDataList<FieldUpgradeData>(Const.FieldUpgradeDataSheet);
|
||||||
var pos = seedlingTransform.position;
|
|
||||||
if (harvestCount > 1)
|
// コーン株の進行度初回データ作成
|
||||||
{
|
foreach (var lineData in gameData.PlantLineDataList)
|
||||||
pos += Vector3.right * (j - 1) * harvestedDistance + Vector3.forward * (j - 1);
|
{
|
||||||
}
|
// コーン株の進行度初回データ作成
|
||||||
this.CallWaitForFrame(harvestedFrameInterval * j, () =>
|
if (!gameData.SeedlingDataList.Exists(data => data.type == lineData.Type))
|
||||||
{
|
{
|
||||||
var harvestAnimation = Instantiate(harvestPrefab, pos, Quaternion.identity, seedlingTransform);
|
var plantLine = plantLines.First(line => line.LineName == lineData.Type);
|
||||||
this.CallWaitForSeconds(.5f, () =>
|
gameData.SeedlingDataList.Add(new SeedlingProgressData
|
||||||
{
|
{
|
||||||
this.CallLerp(.4f, f =>
|
type = lineData.Type,
|
||||||
{
|
Seedlings = Enumerable.Range(0, plantLine.Seedlings.Count).Select(_ => GenerateSeedlingGene(lineData.Level)).ToList()
|
||||||
harvestAnimation.transform.position = Vector3.Lerp(pos, harvestInsertPosition.position, f.EaseInQuadratic());
|
});
|
||||||
}, () =>
|
}
|
||||||
{
|
}
|
||||||
// コーン排出
|
GameDataManager.SaveGameData();
|
||||||
cornHarvester.AddCount(harvestedCorn);
|
|
||||||
Destroy(harvestAnimation);
|
|
||||||
});
|
// セーブデータから畑を復元
|
||||||
});
|
foreach (var plantLine in plantLines)
|
||||||
});
|
{
|
||||||
}
|
if (gameData.PlantLineDataList.FirstOrDefault(data => data.Type == plantLine.LineName) is PlantLineData plantLineData)
|
||||||
// 新しい苗
|
{
|
||||||
var newGene = GenerateSeedlingGene(line.FieldLevel);
|
plantLine.gameObject.SetActive(true);
|
||||||
seedling.SetSeedlingGene(newGene.FirstTime, newGene.Period, newGene.Level);
|
plantLine.SetFieldLevel(plantLineData.Level);
|
||||||
|
|
||||||
|
for (int i = 0; i < plantLine.Seedlings.Count; i++)
|
||||||
|
{
|
||||||
|
var progressData = gameData.SeedlingDataList.First(data => data.type == plantLineData.Type).Seedlings[i];
|
||||||
|
var seedling = plantLine.Seedlings[i];
|
||||||
|
seedling.SetSeedlingGene(progressData.FirstTime, progressData.Period, progressData.Level);
|
||||||
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||||
if (UsayaStorageManager.LoadOrDefault(UsayaStorageFilename.Settings_Data, "DebugFastGrowing", false))
|
if (UsayaStorageManager.LoadOrDefault(UsayaStorageFilename.Settings_Data, "DebugFastGrowing", false))
|
||||||
{
|
{
|
||||||
seedling.SetSeedlingGene(newGene.FirstTime, newGene.Period / 3, newGene.Level);
|
seedling.SetSeedlingGene(progressData.FirstTime, progressData.Period / 3, progressData.Level);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
gameData.SeedlingDataList[seedlingDataIndex].Seedlings[index] = newGene;
|
// 収穫通知
|
||||||
GameDataManager.SaveGameData();
|
seedling.Harvested.Subscribe(_ =>
|
||||||
}).AddTo(compositeDisposable);
|
{
|
||||||
|
VibrationManager.Instance.PlayVibrationOnce();
|
||||||
|
var harvestCount = fieldData.FirstOrDefault(x => x.Type == CornFieldUpgradeType.FieldCenter && x.level == (int)progressData.Level)?.harvested ?? 1;
|
||||||
|
var harvestedCorn = fieldData.FirstOrDefault(x => x.Type == CornFieldUpgradeType.Machine && x.level == gameData.MachineLevel)?.harvested ?? 20;
|
||||||
|
gameData.cornSeed += harvestedCorn * harvestCount;
|
||||||
|
var seedlingTransform = seedling.transform;
|
||||||
|
|
||||||
|
var harvestEffect = Instantiate(harvestEffectPrefab, seedlingTransform);
|
||||||
|
Destroy(harvestEffect, 1f);
|
||||||
|
for (int j = 0; j < harvestCount; j++)
|
||||||
|
{
|
||||||
|
// 株の位置調整
|
||||||
|
var pos = seedlingTransform.position;
|
||||||
|
if (harvestCount > 1)
|
||||||
|
{
|
||||||
|
pos += Vector3.right * (j - 1) * harvestedDistance + Vector3.forward * (j - 1);
|
||||||
|
}
|
||||||
|
this.CallWaitForFrame(harvestedFrameInterval * j, () =>
|
||||||
|
{
|
||||||
|
var harvestAnimation = Instantiate(harvestPrefab, pos, Quaternion.identity, seedlingTransform);
|
||||||
|
this.CallWaitForSeconds(.5f, () =>
|
||||||
|
{
|
||||||
|
this.CallLerp(.4f, f =>
|
||||||
|
{
|
||||||
|
harvestAnimation.transform.position = Vector3.Lerp(pos, harvestInsertPosition.position, f.EaseInQuadratic());
|
||||||
|
}, () =>
|
||||||
|
{
|
||||||
|
// コーン排出
|
||||||
|
cornHarvester.AddCount(harvestedCorn);
|
||||||
|
Destroy(harvestAnimation);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 新しい苗
|
||||||
|
var newGene = GenerateSeedlingGene(plantLineData.Level);
|
||||||
|
seedling.SetSeedlingGene(newGene.FirstTime, newGene.Period, newGene.Level);
|
||||||
|
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||||
|
if (UsayaStorageManager.LoadOrDefault(UsayaStorageFilename.Settings_Data, "DebugFastGrowing", false))
|
||||||
|
{
|
||||||
|
seedling.SetSeedlingGene(newGene.FirstTime, newGene.Period / 3, newGene.Level);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
progressData.Level = newGene.Level;
|
||||||
|
progressData.Period = newGene.Period;
|
||||||
|
progressData.FirstTime = newGene.FirstTime;
|
||||||
|
GameDataManager.SaveGameData();
|
||||||
|
}).AddTo(compositeDisposable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,28 +217,27 @@ public class CornField : MonoBehaviour
|
||||||
promoteGrowthButton.OnClickAsObservable().Subscribe(_ =>
|
promoteGrowthButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
VibrationManager.Instance.PlayVibrationOnce();
|
VibrationManager.Instance.PlayVibrationOnce();
|
||||||
foreach (var line in availableLines)
|
foreach (var plantLine in plantLines)
|
||||||
{
|
{
|
||||||
var seedlingDataIndex = gameData.SeedlingDataList.FindIndex(x => x.type == line.LineName);
|
if (gameData.PlantLineDataList.FirstOrDefault(data => data.Type == plantLine.LineName) is PlantLineData plantLineData)
|
||||||
for (int i = 0; i < line.Seedlings.Count; i++)
|
|
||||||
{
|
{
|
||||||
if (Random.Range(0, 2) == 0)
|
for (int i = 0; i < plantLine.Seedlings.Count; i++)
|
||||||
{
|
{
|
||||||
var tmpData = gameData.SeedlingDataList[seedlingDataIndex].Seedlings[i];
|
if (Random.Range(0, 2) == 0)
|
||||||
tmpData.FirstTime = tmpData.FirstTime.AddSeconds(-1);
|
{
|
||||||
line.Seedlings[i].PromoteGrowth(tmpData.FirstTime);
|
continue;
|
||||||
gameData.SeedlingDataList[seedlingDataIndex].Seedlings[i] = tmpData;
|
}
|
||||||
|
var progressData = gameData.SeedlingDataList.First(data => data.type == plantLineData.Type).Seedlings[i];
|
||||||
|
var seedling = plantLine.Seedlings[i];
|
||||||
|
progressData.FirstTime = progressData.FirstTime.AddSeconds(-1);
|
||||||
|
seedling.PromoteGrowth(progressData.FirstTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 設定のセーブ
|
// 設定のセーブ
|
||||||
GameDataManager.SaveGameData();
|
GameDataManager.SaveGameData();
|
||||||
}).AddTo(compositeDisposable);
|
}).AddTo(compositeDisposable);
|
||||||
|
|
||||||
upgradeButton.OnClickAsObservable().Subscribe(_ =>
|
|
||||||
{
|
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Reinforcement);
|
|
||||||
}).AddTo(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetData()
|
private void SetData()
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ public class CornFieldReinforcement : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static readonly string CornFieldReinforcementDataTypeTag = "CornFieldReinforcementDataType";
|
public static readonly string CornFieldReinforcementDataTypeTag = "CornFieldReinforcementDataType";
|
||||||
public static readonly string CornFieldReinforcementDataTag = "CornFieldReinforcementData";
|
public static readonly string CornFieldReinforcementDataTag = "CornFieldReinforcementData";
|
||||||
|
public static readonly string CornFieldResetCallbackTag = "CornFieldResetCallback";
|
||||||
[SerializeField] private List<CornFieldReinforcementView> reinforcementViews;
|
[SerializeField] private List<CornFieldReinforcementView> reinforcementViews;
|
||||||
[SerializeField] private MachineUpgradeView machineUpgradeView;
|
[SerializeField] private MachineUpgradeView machineUpgradeView;
|
||||||
[SerializeField] private Button closeButton;
|
[SerializeField] private Button closeButton;
|
||||||
|
|
@ -20,9 +21,10 @@ public class CornFieldReinforcement : MonoBehaviour
|
||||||
compositeDisposable.AddTo(this);
|
compositeDisposable.AddTo(this);
|
||||||
closeButton.OnClickAsObservable().Subscribe(_ =>
|
closeButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
TransitionManager.Instance.UnloadScene(GameScenes.Reinforcement);
|
|
||||||
LocalCacheManager.Remove(CornFieldReinforcementDataTypeTag);
|
LocalCacheManager.Remove(CornFieldReinforcementDataTypeTag);
|
||||||
LocalCacheManager.Remove(CornFieldReinforcementDataTag);
|
LocalCacheManager.Remove(CornFieldReinforcementDataTag);
|
||||||
|
LocalCacheManager.Remove(CornFieldResetCallbackTag);
|
||||||
|
TransitionManager.Instance.UnloadScene(GameScenes.Reinforcement);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
SetView();
|
SetView();
|
||||||
}
|
}
|
||||||
|
|
@ -57,6 +59,7 @@ public class CornFieldReinforcement : MonoBehaviour
|
||||||
LocalCacheManager.Save(CornFieldReinforcementDataTag, (lineData, price, new Action(() => {
|
LocalCacheManager.Save(CornFieldReinforcementDataTag, (lineData, price, new Action(() => {
|
||||||
PurchaseField(price, view.LineType, nextRank);
|
PurchaseField(price, view.LineType, nextRank);
|
||||||
SetView();
|
SetView();
|
||||||
|
LocalCacheManager.Load<Action>(CornFieldResetCallbackTag, null)?.Invoke();
|
||||||
})));
|
})));
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ReinforcementDetail);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ReinforcementDetail);
|
||||||
}).AddTo(compositeDisposable);
|
}).AddTo(compositeDisposable);
|
||||||
|
|
@ -74,6 +77,7 @@ public class CornFieldReinforcement : MonoBehaviour
|
||||||
LocalCacheManager.Save(CornFieldReinforcementDataTag, (lineData = null, price, new Action(() => {
|
LocalCacheManager.Save(CornFieldReinforcementDataTag, (lineData = null, price, new Action(() => {
|
||||||
PurchaseField(price, view.LineType, CornFieldRank.Rank1);
|
PurchaseField(price, view.LineType, CornFieldRank.Rank1);
|
||||||
SetView();
|
SetView();
|
||||||
|
LocalCacheManager.Load<Action>(CornFieldResetCallbackTag, null)?.Invoke();
|
||||||
})));
|
})));
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ReinforcementDetail);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ReinforcementDetail);
|
||||||
}).AddTo(compositeDisposable);
|
}).AddTo(compositeDisposable);
|
||||||
|
|
@ -99,6 +103,7 @@ public class CornFieldReinforcement : MonoBehaviour
|
||||||
LocalCacheManager.Save(CornFieldReinforcementDataTag, (gameData.MachineLevel, price, new Action(() => {
|
LocalCacheManager.Save(CornFieldReinforcementDataTag, (gameData.MachineLevel, price, new Action(() => {
|
||||||
PurchaseMachine(price);
|
PurchaseMachine(price);
|
||||||
SetView();
|
SetView();
|
||||||
|
LocalCacheManager.Load<Action>(CornFieldResetCallbackTag, null)?.Invoke();
|
||||||
})));
|
})));
|
||||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ReinforcementDetail);
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ReinforcementDetail);
|
||||||
}).AddTo(compositeDisposable);
|
}).AddTo(compositeDisposable);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ public class CornFieldReinforcementDetailView : MonoBehaviour
|
||||||
{
|
{
|
||||||
Action callback;
|
Action callback;
|
||||||
var upgradeType = LocalCacheManager.Load<CornFieldUpgradeType>(CornFieldReinforcement.CornFieldReinforcementDataTypeTag);
|
var upgradeType = LocalCacheManager.Load<CornFieldUpgradeType>(CornFieldReinforcement.CornFieldReinforcementDataTypeTag);
|
||||||
Debug.Log(upgradeType);
|
|
||||||
switch (upgradeType)
|
switch (upgradeType)
|
||||||
{
|
{
|
||||||
case CornFieldUpgradeType.FieldTop:
|
case CornFieldUpgradeType.FieldTop:
|
||||||
|
|
@ -79,6 +78,8 @@ public class CornFieldReinforcementDetailView : MonoBehaviour
|
||||||
{
|
{
|
||||||
ReinforceObject.SetActive(false);
|
ReinforceObject.SetActive(false);
|
||||||
ReleaseObject.SetActive(true);
|
ReleaseObject.SetActive(true);
|
||||||
|
purchaseButton.gameObject.SetActive(false);
|
||||||
|
releaseButton.gameObject.SetActive(true);
|
||||||
releasePriceText.text = price.ToString();
|
releasePriceText.text = price.ToString();
|
||||||
messageText.text = ReleaseFormat;
|
messageText.text = ReleaseFormat;
|
||||||
}
|
}
|
||||||
|
|
@ -86,6 +87,8 @@ public class CornFieldReinforcementDetailView : MonoBehaviour
|
||||||
{
|
{
|
||||||
ReinforceObject.SetActive(true);
|
ReinforceObject.SetActive(true);
|
||||||
ReleaseObject.SetActive(false);
|
ReleaseObject.SetActive(false);
|
||||||
|
purchaseButton.gameObject.SetActive(true);
|
||||||
|
releaseButton.gameObject.SetActive(false);
|
||||||
reinforcePriceText.text = price.ToString();
|
reinforcePriceText.text = price.ToString();
|
||||||
var nextRank = CornFieldReinforcement.GetNextRank(data.Level);
|
var nextRank = CornFieldReinforcement.GetNextRank(data.Level);
|
||||||
var upgradeType = FieldUpgradeData.PlantTypeToUpgradeType(data.Type);
|
var upgradeType = FieldUpgradeData.PlantTypeToUpgradeType(data.Type);
|
||||||
|
|
@ -103,5 +106,7 @@ public class CornFieldReinforcementDetailView : MonoBehaviour
|
||||||
{
|
{
|
||||||
ReinforceObject.SetActive(false);
|
ReinforceObject.SetActive(false);
|
||||||
ReleaseObject.SetActive(false);
|
ReleaseObject.SetActive(false);
|
||||||
|
purchaseButton.gameObject.SetActive(true);
|
||||||
|
releaseButton.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class CornSeedling : MonoBehaviour, IPointerEnterHandler
|
||||||
{
|
{
|
||||||
completed = false;
|
completed = false;
|
||||||
compositeDisposable.Clear();
|
compositeDisposable.Clear();
|
||||||
seedlingStage.SetValueAndForceNotify(SeedlingStage.Stage0);
|
UpdateStage();
|
||||||
beginTime = dateTime;
|
beginTime = dateTime;
|
||||||
period = periodTime;
|
period = periodTime;
|
||||||
|
|
||||||
|
|
@ -69,6 +69,7 @@ public class CornSeedling : MonoBehaviour, IPointerEnterHandler
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
seedlingStage
|
seedlingStage
|
||||||
|
.SkipLatestValueOnSubscribe()
|
||||||
.TakeWhile(_ => !completed)
|
.TakeWhile(_ => !completed)
|
||||||
.Subscribe(x =>
|
.Subscribe(x =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,10 @@ public class PlantLine : MonoBehaviour
|
||||||
[SerializeField] private List<CornSeedling> seedlings = new List<CornSeedling>();
|
[SerializeField] private List<CornSeedling> seedlings = new List<CornSeedling>();
|
||||||
public PlantLineType LineName => lineName;
|
public PlantLineType LineName => lineName;
|
||||||
public List<CornSeedling> Seedlings => seedlings;
|
public List<CornSeedling> Seedlings => seedlings;
|
||||||
public CornFieldRank FieldLevel { get; private set; }
|
|
||||||
private readonly string boardFormat = "x{0}";
|
private readonly string boardFormat = "x{0}";
|
||||||
|
|
||||||
public void SetFieldLevel(CornFieldRank rank)
|
public void SetFieldLevel(CornFieldRank rank)
|
||||||
{
|
{
|
||||||
FieldLevel = rank;
|
|
||||||
switch (rank)
|
switch (rank)
|
||||||
{
|
{
|
||||||
case CornFieldRank.Rank1:
|
case CornFieldRank.Rank1:
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 182afe41c8e664bf3a0e8f43acbdb199
|
guid: 7f040d1b248234841802683edae3c4fa
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|
|
||||||
|
|
@ -27,13 +27,12 @@ public class KitchenManager : MonoBehaviour
|
||||||
|
|
||||||
kitchenView.Initialize();
|
kitchenView.Initialize();
|
||||||
adButton.gameObject.SetActive(false);
|
adButton.gameObject.SetActive(false);
|
||||||
kitchenView.SetNormalAnimation();
|
|
||||||
|
// 動画視聴可能かどうかはシーンロード時に確認
|
||||||
|
// kitchenView.SetNormalAnimation();
|
||||||
#if UNITY_EDITOR || DEVELOPMENT_BUILD
|
#if UNITY_EDITOR || DEVELOPMENT_BUILD
|
||||||
Observable.Timer(TimeSpan.FromSeconds(3f)).Subscribe(_ =>
|
adButton.gameObject.SetActive(true);
|
||||||
{
|
kitchenView.SetTiredAnimation();
|
||||||
adButton.gameObject.SetActive(true);
|
|
||||||
kitchenView.SetTiredAnimation();
|
|
||||||
}).AddTo(this);
|
|
||||||
adButton.OnClickAsObservable().Subscribe(_ =>
|
adButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
{
|
{
|
||||||
// 動画視聴POP
|
// 動画視聴POP
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue