Merge branch 'develop' of bitbucket.org:usaya/popcorn into develop
This commit is contained in:
commit
28030e03e1
|
|
@ -5703,7 +5703,7 @@ Material:
|
|||
- _ColorMask: 15
|
||||
- _CullMode: 0
|
||||
- _Diffuse: 0.5
|
||||
- _FaceDilate: 0.82
|
||||
- _FaceDilate: 0.5
|
||||
- _FaceUVSpeedX: 0
|
||||
- _FaceUVSpeedY: 0
|
||||
- _GlowInner: 0.05
|
||||
|
|
@ -5720,9 +5720,9 @@ Material:
|
|||
- _OutlineWidth: 0.63
|
||||
- _PerspectiveFilter: 0.875
|
||||
- _Reflectivity: 10
|
||||
- _ScaleRatioA: 0.5496183
|
||||
- _ScaleRatioB: 0
|
||||
- _ScaleRatioC: 0
|
||||
- _ScaleRatioA: 0.68311197
|
||||
- _ScaleRatioB: 0.28125
|
||||
- _ScaleRatioC: 0.28125
|
||||
- _ScaleX: 1
|
||||
- _ScaleY: 1
|
||||
- _ShaderFlags: 0
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 330 KiB After Width: | Height: | Size: 340 KiB |
|
|
@ -2386,6 +2386,7 @@ MonoBehaviour:
|
|||
sideButtons: {fileID: 1735316554}
|
||||
promoteGrowthButton: {fileID: 730756546}
|
||||
upgradeButton: {fileID: 974444277}
|
||||
upgradeButtonBadge: {fileID: 737572416}
|
||||
harvestEffectPrefab: {fileID: 3900911687800301846, guid: e9a7e2b2f003d44fab5926ca6ec6d728,
|
||||
type: 3}
|
||||
harvestPrefab: {fileID: 8524901521850801684, guid: e642499b3643dab4ba05b02e8c6bde1c,
|
||||
|
|
@ -2593,6 +2594,12 @@ RectTransform:
|
|||
type: 3}
|
||||
m_PrefabInstance: {fileID: 737572414}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &737572416 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 9056949049436837036, guid: f8587bb162250fa48947d648e934781e,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 737572414}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &769574933
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public class CornField : MonoBehaviour
|
|||
[SerializeField] private GameObject sideButtons;
|
||||
[SerializeField] private Button promoteGrowthButton;
|
||||
[SerializeField] private Button upgradeButton;
|
||||
[SerializeField] private GameObject upgradeButtonBadge;
|
||||
[SerializeField] private GameObject harvestEffectPrefab;
|
||||
[SerializeField] private GameObject harvestPrefab;
|
||||
[SerializeField] private Transform harvestSpawnTarget;
|
||||
|
|
@ -103,8 +104,7 @@ public class CornField : MonoBehaviour
|
|||
|
||||
upgradeButton.OnClickAsObservable().ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ =>
|
||||
{
|
||||
LocalCacheManager.Save(CornFieldReinforcement.CornFieldResetCallbackTag, new Action(() => SetCornField()));
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Reinforcement);
|
||||
CornFieldReinforcement.ShowDialog(() => SetCornField());
|
||||
}).AddTo(this);
|
||||
|
||||
fertilizerButtonView.RewardButton.ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ =>
|
||||
|
|
@ -309,7 +309,6 @@ public class CornField : MonoBehaviour
|
|||
}
|
||||
GameDataManager.SaveGameData();
|
||||
|
||||
|
||||
// セーブデータから畑を復元
|
||||
foreach (var plantLine in plantLines)
|
||||
{
|
||||
|
|
@ -420,6 +419,31 @@ public class CornField : MonoBehaviour
|
|||
// 設定のセーブ
|
||||
GameDataManager.SaveGameData();
|
||||
}).AddTo(compositeDisposable);
|
||||
|
||||
// 強化ボタン通知
|
||||
var upgradePrice = int.MaxValue;
|
||||
if (fieldData.FirstOrDefault(x => x.Type == CornFieldUpgradeType.Machine && x.level == gameData.MachineLevel + 1)?.price is int nextMachinePrice)
|
||||
{
|
||||
upgradePrice = Mathf.Min(upgradePrice, nextMachinePrice);
|
||||
}
|
||||
foreach (var plantLine in plantLines)
|
||||
{
|
||||
var upgradeType = FieldUpgradeData.PlantTypeToUpgradeType(plantLine.LineName);
|
||||
var nextRank = CornFieldRank.Rank1;
|
||||
if (gameData.PlantLineDataList.FirstOrDefault(data => data.Type == plantLine.LineName) is PlantLineData plantLineData)
|
||||
{
|
||||
if (plantLineData.Level == CornFieldRank.Rank3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
nextRank = CornFieldReinforcement.GetNextRank(plantLineData.Level);
|
||||
}
|
||||
if (fieldData.FirstOrDefault(x => x.Type == upgradeType && x.level == (int) nextRank)?.price is int nextPrice)
|
||||
{
|
||||
upgradePrice = Mathf.Min(upgradePrice, nextPrice);
|
||||
}
|
||||
}
|
||||
upgradeButtonBadge.SetActive(upgradePrice <= CoinManager.Instance.OwnCoin);
|
||||
}
|
||||
|
||||
private IDisposable SetFertilizerTimer(int time)
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@ public class CornFieldReinforcement : MonoBehaviour
|
|||
{
|
||||
public static readonly string CornFieldReinforcementDataTypeTag = "CornFieldReinforcementDataType";
|
||||
public static readonly string CornFieldReinforcementDataTag = "CornFieldReinforcementData";
|
||||
public static readonly string CornFieldResetCallbackTag = "CornFieldResetCallback";
|
||||
private static readonly string CornFieldResetCallbackTag = "CornFieldResetCallback";
|
||||
[SerializeField] private List<CornFieldReinforcementView> reinforcementViews;
|
||||
[SerializeField] private MachineUpgradeView machineUpgradeView;
|
||||
[SerializeField] private Button closeButton;
|
||||
|
||||
private CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
private readonly CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
|
@ -147,4 +147,10 @@ public class CornFieldReinforcement : MonoBehaviour
|
|||
throw new ArgumentOutOfRangeException(nameof(rank), rank, null);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowDialog(Action onClose = null)
|
||||
{
|
||||
LocalCacheManager.Save(CornFieldResetCallbackTag, onClose);
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.Reinforcement);
|
||||
}
|
||||
}
|
||||
|
|
@ -119,6 +119,9 @@ public class DebugOptionManager : MonoBehaviour
|
|||
bulkOrderResetButton.OnClickAsObservable().Subscribe(_ =>
|
||||
{
|
||||
gameData.AchievedOrderLevel = 0;
|
||||
gameData.OrderIdInProgress = 0;
|
||||
gameData.CancelOrderId = 0;
|
||||
gameData.CompletedProductList.Clear();
|
||||
}).AddTo(this);
|
||||
|
||||
shopLevelUpResetButton.OnClickAsObservable().Subscribe(_ =>
|
||||
|
|
|
|||
|
|
@ -369,6 +369,7 @@ MonoBehaviour:
|
|||
indicatorAnimator: {fileID: 8309988580877545720}
|
||||
titleObject: {fileID: 6630966004704031400}
|
||||
balloonObject: {fileID: 1129648163941645728}
|
||||
completedBadgeObject: {fileID: 659548414025622818}
|
||||
--- !u!1 &6630966004704031400
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -597,6 +598,12 @@ PrefabInstance:
|
|||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: f8587bb162250fa48947d648e934781e, type: 3}
|
||||
--- !u!1 &659548414025622818 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 9056949049436837036, guid: f8587bb162250fa48947d648e934781e,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8401342945157312910}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!224 &323767120578515127 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 8136263580696535353, guid: f8587bb162250fa48947d648e934781e,
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ public class BulkOrder : MonoBehaviour
|
|||
{
|
||||
public static readonly string DataTag = "BulkOrderData";
|
||||
public static readonly string MaterialNumberTag = "BulkOrderMaterialNumber";
|
||||
public static readonly string CancelCallbackTag = "BulkOrderCancelCallback";
|
||||
public static readonly string AchievedCallbackTag = "BulkOrderAchievedCallback";
|
||||
private static readonly string CancelCallbackTag = "BulkOrderCancelCallback";
|
||||
private static readonly string AchievedCallbackTag = "BulkOrderAchievedCallback";
|
||||
private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger");
|
||||
private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger");
|
||||
[SerializeField] private Animator backgroundAnimator;
|
||||
|
|
@ -57,7 +57,7 @@ public class BulkOrder : MonoBehaviour
|
|||
LocalCacheManager.Save(DataTag, bulkOrderData);
|
||||
cancelButton.OnClickAsObservable().ThrottleFirst(TimeSpan.FromSeconds(1f)).Subscribe(_ =>
|
||||
{
|
||||
LocalCacheManager.Save(CancelCallbackTag, new Action(() =>
|
||||
BulkOrderCancelView.ShowDialog(() =>
|
||||
{
|
||||
// 試食数追加
|
||||
if (gameData.CompletedProductList.Exists(data => data.Number == 1))
|
||||
|
|
@ -76,6 +76,8 @@ public class BulkOrder : MonoBehaviour
|
|||
// カウントリセット
|
||||
gameData.OrderConditionCount = 0;
|
||||
GameDataManager.SaveGameData();
|
||||
LocalCacheManager.Load<Action>(CancelCallbackTag, null)?.Invoke();
|
||||
LocalCacheManager.Remove(CancelCallbackTag);
|
||||
// キャンセルと同時に閉じる
|
||||
transform.parent.SetLocalScale(0);
|
||||
backgroundAnimator.SetTrigger(CloseTrigger);
|
||||
|
|
@ -83,8 +85,7 @@ public class BulkOrder : MonoBehaviour
|
|||
{
|
||||
TransitionManager.Instance.UnloadScene(GameScenes.BulkOrder);
|
||||
});
|
||||
}));
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrderCancel);
|
||||
});
|
||||
}).AddTo(this);
|
||||
|
||||
// 納品チェック
|
||||
|
|
@ -106,7 +107,7 @@ public class BulkOrder : MonoBehaviour
|
|||
// 納品
|
||||
deliveredButton.OnClickAsObservable().ThrottleFirst(TimeSpan.FromSeconds(1f)).Subscribe(_ =>
|
||||
{
|
||||
LocalCacheManager.Save(AchievedCallbackTag, new Action(() =>
|
||||
BulkOrderAchievedView.ShowDialog(() =>
|
||||
{
|
||||
// 獲得
|
||||
var rarityList = SpreadsheetDataManager.Instance.GetBaseDataList<RarityData>(Const.RarityDataSheet);
|
||||
|
|
@ -131,11 +132,12 @@ public class BulkOrder : MonoBehaviour
|
|||
gameData.AchievedOrderLevel = bulkOrderData.shopLevel;
|
||||
}
|
||||
GameDataManager.SaveGameData();
|
||||
LocalCacheManager.Load<Action>(AchievedCallbackTag, null)?.Invoke();
|
||||
LocalCacheManager.Remove(AchievedCallbackTag);
|
||||
TransitionManager.Instance.UnloadScene(GameScenes.BulkOrder);
|
||||
}));
|
||||
});
|
||||
transform.SetLocalScale(0);
|
||||
backgroundAnimator.SetTrigger(CloseTrigger);
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrderAchievement);
|
||||
}).AddTo(this);
|
||||
|
||||
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
|
||||
|
|
@ -221,6 +223,14 @@ public class BulkOrder : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public static void ShowDialog(Action onComplete = null, Action onAchieved = null, Action onCancel = null)
|
||||
{
|
||||
LocalCacheManager.Remove(Const.ProductViewTypeTag);
|
||||
LocalCacheManager.Save(AchievedCallbackTag, onAchieved);
|
||||
LocalCacheManager.Save(CancelCallbackTag, onCancel);
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrder);
|
||||
}
|
||||
|
||||
public static int CalcBonus(List<RarityData> rarityList, List<BulkOrderResultData> resultData, int shopLevel)
|
||||
{
|
||||
var totalBonus = 0;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using UnityEngine.UI;
|
|||
|
||||
public class BulkOrderAchievedView : MonoBehaviour
|
||||
{
|
||||
private static readonly string CallbackTag = "BulkOrderAchievedViewCallback";
|
||||
private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger");
|
||||
private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger");
|
||||
[SerializeField] private Animator backgroundAnimator;
|
||||
|
|
@ -34,14 +35,8 @@ public class BulkOrderAchievedView : MonoBehaviour
|
|||
}
|
||||
closeButton.OnClickAsObservable().Take(1).Subscribe(_ =>
|
||||
{
|
||||
if (LocalCacheManager.Load<Action>(BulkOrder.AchievedCallbackTag, null) is Action callback)
|
||||
{
|
||||
callback.Invoke();
|
||||
}
|
||||
if (LocalCacheManager.Load<Action>(KitchenManager.ArchivedCallbackTag, null) is Action kitchenCallback)
|
||||
{
|
||||
kitchenCallback.Invoke();
|
||||
}
|
||||
LocalCacheManager.Load<Action>(CallbackTag, null)?.Invoke();
|
||||
LocalCacheManager.Remove(CallbackTag);
|
||||
transform.parent.SetLocalScale(0);
|
||||
backgroundAnimator.SetTrigger(CloseTrigger);
|
||||
this.CallWaitForSeconds(.25f, () =>
|
||||
|
|
@ -50,4 +45,10 @@ public class BulkOrderAchievedView : MonoBehaviour
|
|||
});
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
||||
public static void ShowDialog(Action onComplete = null)
|
||||
{
|
||||
LocalCacheManager.Save(CallbackTag, onComplete);
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrderAchievement);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using UnityEngine.UI;
|
|||
|
||||
public class BulkOrderCancelView : MonoBehaviour
|
||||
{
|
||||
private static readonly string CallbackTag = "BulkOrderCancelViewCallback";
|
||||
private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger");
|
||||
private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger");
|
||||
[SerializeField] private Animator backgroundAnimator;
|
||||
|
|
@ -32,14 +33,8 @@ public class BulkOrderCancelView : MonoBehaviour
|
|||
}).AddTo(this);
|
||||
cancelButton.OnClickAsObservable().Take(1).Subscribe(_ =>
|
||||
{
|
||||
if (LocalCacheManager.Load<Action>(BulkOrder.CancelCallbackTag, null) is Action callback)
|
||||
{
|
||||
callback.Invoke();
|
||||
}
|
||||
if (LocalCacheManager.Load<Action>(KitchenManager.ArchivedCallbackTag, null) is Action kitchenCallback)
|
||||
{
|
||||
kitchenCallback.Invoke();
|
||||
}
|
||||
LocalCacheManager.Load<Action>(CallbackTag, null)?.Invoke();
|
||||
LocalCacheManager.Remove(CallbackTag);
|
||||
transform.parent.SetLocalScale(0);
|
||||
backgroundAnimator.SetTrigger(CloseTrigger);
|
||||
this.CallWaitForSeconds(.25f, () =>
|
||||
|
|
@ -48,4 +43,10 @@ public class BulkOrderCancelView : MonoBehaviour
|
|||
});
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
||||
public static void ShowDialog(Action onComplete = null)
|
||||
{
|
||||
LocalCacheManager.Save(CallbackTag, onComplete);
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrderCancel);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public class BulkOrderIndicatorView : MonoBehaviour
|
|||
[SerializeField] private Animator indicatorAnimator;
|
||||
[SerializeField] private GameObject titleObject;
|
||||
[SerializeField] private GameObject balloonObject;
|
||||
[SerializeField] private GameObject completedBadgeObject;
|
||||
|
||||
private static readonly int Ring = Animator.StringToHash("Ring");
|
||||
private static readonly int Wait = Animator.StringToHash("Wait");
|
||||
|
|
@ -32,4 +33,9 @@ public class BulkOrderIndicatorView : MonoBehaviour
|
|||
titleObject.SetActive(!receive && !achieved);
|
||||
balloonObject.SetActive(receive);
|
||||
}
|
||||
|
||||
public void SetBadgeActive(bool active)
|
||||
{
|
||||
completedBadgeObject.SetActive(active);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ using UnityEngine.UI;
|
|||
|
||||
public class KitchenManager : MonoBehaviour
|
||||
{
|
||||
public static readonly string ArchivedCallbackTag = "KitchenCancelCallback";
|
||||
private static readonly double refreshWaitTime = 300;
|
||||
[SerializeField] int refreshRewardCoin = 100;
|
||||
[SerializeField] private Button cookingButton;
|
||||
|
|
@ -148,10 +147,23 @@ public class KitchenManager : MonoBehaviour
|
|||
var achieved = bulkOrderData is null || gameData.DeliveredOrder.Contains(bulkOrderData.id) || gameData.AchievedOrderLevel == bulkOrderData.shopLevel;
|
||||
var cancelled = gameData.OrderIdInProgress == gameData.CancelOrderId;
|
||||
GameDataManager.SaveGameData();
|
||||
LocalCacheManager.Save(ArchivedCallbackTag, new Action(() =>
|
||||
|
||||
if (bulkOrderData != null)
|
||||
{
|
||||
orderIndicatorView.SetIndicate(false, true);
|
||||
}));
|
||||
var orderList = new List<int>
|
||||
{
|
||||
bulkOrderData.productId1,
|
||||
bulkOrderData.productId2,
|
||||
bulkOrderData.productId3,
|
||||
};
|
||||
var completed = gameData.CompletedProductList.Count == orderList.Count(x => x != 0);
|
||||
orderIndicatorView.SetBadgeActive(completed && !achieved);
|
||||
}
|
||||
else
|
||||
{
|
||||
orderIndicatorView.SetBadgeActive(false);
|
||||
}
|
||||
|
||||
orderIndicatorView.SetIndicate(result.result, achieved || cancelled);
|
||||
if (result.result)
|
||||
{
|
||||
|
|
@ -181,11 +193,23 @@ public class KitchenManager : MonoBehaviour
|
|||
|
||||
// 通知をタップ後タップ動作を切り替える
|
||||
orderIndicatorView.SetIndicate(false, false);
|
||||
orderIndicatorView.TappedPhone.ThrottleFirst(TimeSpan.FromSeconds(1f)).Subscribe(__ =>
|
||||
{
|
||||
LocalCacheManager.Remove(Const.ProductViewTypeTag);
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrder);
|
||||
}).AddTo(this);
|
||||
orderIndicatorView.TappedPhone
|
||||
.ThrottleFirst(TimeSpan.FromSeconds(1f))
|
||||
.Take(1)
|
||||
.Subscribe(__ =>
|
||||
{
|
||||
BulkOrder.ShowDialog(
|
||||
onAchieved: () =>
|
||||
{
|
||||
orderIndicatorView.SetIndicate(false, true);
|
||||
orderIndicatorView.SetBadgeActive(false);
|
||||
},
|
||||
onCancel: () =>
|
||||
{
|
||||
orderIndicatorView.SetIndicate(false, true);
|
||||
orderIndicatorView.SetBadgeActive(false);
|
||||
});
|
||||
}).AddTo(this);
|
||||
}).AddTo(this);
|
||||
}
|
||||
else
|
||||
|
|
@ -196,8 +220,17 @@ public class KitchenManager : MonoBehaviour
|
|||
.ThrottleFirst(TimeSpan.FromSeconds(1f))
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
LocalCacheManager.Remove(Const.ProductViewTypeTag);
|
||||
TransitionManager.Instance.LoadSceneAdditive(GameScenes.BulkOrder);
|
||||
BulkOrder.ShowDialog(
|
||||
onAchieved: () =>
|
||||
{
|
||||
orderIndicatorView.SetIndicate(false, true);
|
||||
orderIndicatorView.SetBadgeActive(false);
|
||||
},
|
||||
onCancel: () =>
|
||||
{
|
||||
orderIndicatorView.SetIndicate(false, true);
|
||||
orderIndicatorView.SetBadgeActive(false);
|
||||
});
|
||||
}).AddTo(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue