畑強化シーン登録/クラス追加
This commit is contained in:
parent
444a04ee6f
commit
98ee04f430
File diff suppressed because it is too large
Load Diff
|
|
@ -1888,6 +1888,52 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1831113453}
|
m_GameObject: {fileID: 1831113453}
|
||||||
m_CullTransparentMesh: 0
|
m_CullTransparentMesh: 0
|
||||||
|
--- !u!1 &1848874147
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1848874149}
|
||||||
|
- component: {fileID: 1848874148}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Manager
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1848874148
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1848874147}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e55b8c98071244749d187c1ace62f87c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
reinforcementViews: []
|
||||||
|
machineUpgradeView: {fileID: 0}
|
||||||
|
closeButton: {fileID: 1440832245}
|
||||||
|
--- !u!4 &1848874149
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1848874147}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -0.65419304, y: 0.30638707, z: -0.28896835}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 1
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1856661548
|
--- !u!1 &1856661548
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ public enum CornFieldRank
|
||||||
public class CornField : MonoBehaviour
|
public class CornField : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private Button promoteGrowthButton;
|
[SerializeField] private Button promoteGrowthButton;
|
||||||
|
[SerializeField] private Button upgradeButton;
|
||||||
[SerializeField] private GameObject harvestPrefab;
|
[SerializeField] private GameObject harvestPrefab;
|
||||||
[SerializeField] private Transform harvestInsertPosition;
|
[SerializeField] private Transform harvestInsertPosition;
|
||||||
[SerializeField] private CornHarvester cornHarvester;
|
[SerializeField] private CornHarvester cornHarvester;
|
||||||
|
|
@ -210,6 +211,11 @@ public class CornField : MonoBehaviour
|
||||||
// 設定のセーブ
|
// 設定のセーブ
|
||||||
GameDataManager.SaveGameData();
|
GameDataManager.SaveGameData();
|
||||||
}).AddTo(compositeDisposable);
|
}).AddTo(compositeDisposable);
|
||||||
|
|
||||||
|
upgradeButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
|
{
|
||||||
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Reinforcement);
|
||||||
|
}).AddTo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetData()
|
private void SetData()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UniRx;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class CornFieldReinforcement : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] private List<CornFieldReinforcementView> reinforcementViews;
|
||||||
|
[SerializeField] private MachineUpgradeView machineUpgradeView;
|
||||||
|
[SerializeField] private Button closeButton;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
closeButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
|
{
|
||||||
|
TransitionManager.Instance.UnloadScene(GameScenes.Reinforcement);
|
||||||
|
}).AddTo(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpgradeData
|
||||||
|
{
|
||||||
|
public int category;
|
||||||
|
public int price;
|
||||||
|
public int spec;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e55b8c98071244749d187c1ace62f87c
|
||||||
|
timeCreated: 1632801334
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using UniRx;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class CornFieldReinforcementView : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] private Button dialogButton;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
dialogButton.OnClickAsObservable().Subscribe(_ =>
|
||||||
|
{
|
||||||
|
TransitionManager.Instance.LoadSceneAdditive(GameScenes.ReinforcementDetail);
|
||||||
|
}).AddTo(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 420b443627944f0cb76fdb18505b5ee2
|
||||||
|
timeCreated: 1632801395
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using UniRx;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
public class FacilityExpantion : MonoBehaviour
|
|
||||||
{
|
|
||||||
[SerializeField] private GameObject content;
|
|
||||||
[SerializeField] private Button menuButton;
|
|
||||||
[SerializeField] private Button closeButton;
|
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
content.transform.parent.gameObject.SetActive(false);
|
|
||||||
menuButton.OnClickAsObservable().Subscribe(_ =>
|
|
||||||
{
|
|
||||||
content.transform.parent.gameObject.SetActive(true);
|
|
||||||
});
|
|
||||||
closeButton.OnClickAsObservable().Subscribe(_ =>
|
|
||||||
{
|
|
||||||
content.transform.parent.gameObject.SetActive(false);
|
|
||||||
});
|
|
||||||
// 設備一覧を表示
|
|
||||||
var items = content.GetComponentsInChildren<FacilityExpantionItem>();
|
|
||||||
// 適用できるかどうか判定
|
|
||||||
foreach (var item in items)
|
|
||||||
{
|
|
||||||
if (!GameDataManager.GameData.PlantLineDataList.Exists(x => x.Type == item.Type))
|
|
||||||
{
|
|
||||||
item.SetItem(false, CornFieldRank.Rank1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
item.SetItem(true, GameDataManager.GameData.PlantLineDataList.First(x => x.Type == item.Type).Level);
|
|
||||||
item.ClickObservable.Subscribe(_ =>
|
|
||||||
{
|
|
||||||
// 購入時コイン比較後、コイン減算(ここコイン増加と処理がかぶるとややこしい(Batchとかで処理するといいかも
|
|
||||||
// 購入した設備はセーブする(設備ごとの処理int増やすなど
|
|
||||||
}).AddTo(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int GetPrice(bool hasField, CornFieldRank level)
|
|
||||||
{
|
|
||||||
if (!hasField)
|
|
||||||
{
|
|
||||||
return 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (level)
|
|
||||||
{
|
|
||||||
case CornFieldRank.Rank1:
|
|
||||||
return 500;
|
|
||||||
case CornFieldRank.Rank2:
|
|
||||||
return 500;
|
|
||||||
case CornFieldRank.Rank3:
|
|
||||||
return 500;
|
|
||||||
default:
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(level), level, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 2737c6833764451799b01f31c062873d
|
|
||||||
timeCreated: 1627964670
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
using System;
|
|
||||||
using UniRx;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
public class FacilityExpantionItem : MonoBehaviour
|
|
||||||
{
|
|
||||||
[SerializeField] private PlantLineType type;
|
|
||||||
[SerializeField] private Text text;
|
|
||||||
[SerializeField] private Text buttonText;
|
|
||||||
[SerializeField] private Button button;
|
|
||||||
public PlantLineType Type => type;
|
|
||||||
public IObservable<Unit> ClickObservable => button.OnClickAsObservable();
|
|
||||||
private readonly ReactiveProperty<bool> isAvailable = new ReactiveProperty<bool>();
|
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
isAvailable.AddTo(this);
|
|
||||||
isAvailable.SubscribeToInteractable(button);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetItem(bool hasField, CornFieldRank level)
|
|
||||||
{
|
|
||||||
if (hasField)
|
|
||||||
{
|
|
||||||
// 強化
|
|
||||||
buttonText.text = GetButtonText(level);
|
|
||||||
text.text = GetLevelUpText(level);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 畑の拡張
|
|
||||||
buttonText.text = $"購入";
|
|
||||||
text.text = $"畑を拡張します\n収穫できる株が4つ増えます";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetCoin(int coin)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetButtonText(CornFieldRank level)
|
|
||||||
{
|
|
||||||
switch (level)
|
|
||||||
{
|
|
||||||
case CornFieldRank.Rank1:
|
|
||||||
case CornFieldRank.Rank2:
|
|
||||||
case CornFieldRank.Rank3:
|
|
||||||
return $"購入";
|
|
||||||
default:
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(level), level, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetLevelUpText(CornFieldRank level)
|
|
||||||
{
|
|
||||||
switch (level)
|
|
||||||
{
|
|
||||||
case CornFieldRank.Rank1:
|
|
||||||
return $"畑の質を強化\nx1 -> x2";
|
|
||||||
case CornFieldRank.Rank2:
|
|
||||||
return $"畑の質を強化\nx2 -> x3";
|
|
||||||
case CornFieldRank.Rank3:
|
|
||||||
return $"最大値です";
|
|
||||||
default:
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(level), level, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 902f2e4f44b64ff59cc3aca9a5ff89e5
|
|
||||||
timeCreated: 1627970679
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class MachineUpgradeView : MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6e1d854606044948a8c4f506b9438ee8
|
||||||
|
timeCreated: 1632801827
|
||||||
|
|
@ -10,6 +10,8 @@ public enum GameScenes
|
||||||
Cooking,
|
Cooking,
|
||||||
CookingResults,
|
CookingResults,
|
||||||
CornField,
|
CornField,
|
||||||
|
Reinforcement,
|
||||||
|
ReinforcementDetail,
|
||||||
Recipe,
|
Recipe,
|
||||||
RecipeChoice,
|
RecipeChoice,
|
||||||
marketing,
|
marketing,
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,10 @@ EditorBuildSettings:
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/MyGame/Scenes/DebugOption/DebugOption.unity
|
path: Assets/MyGame/Scenes/DebugOption/DebugOption.unity
|
||||||
guid: fe763d31ed9d54598b71a92ae78adefe
|
guid: fe763d31ed9d54598b71a92ae78adefe
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/MyGame/Scenes/CornField/Reinforcement.unity
|
||||||
|
guid: 857c96f84cd00db4daf9e1057759d3ed
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/MyGame/Scenes/CornField/ReinforcementDetail.unity
|
||||||
|
guid: fde7be5e688a5304d9d549378a5b670f
|
||||||
m_configObjects: {}
|
m_configObjects: {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue