自動調理の完成通知を実装

This commit is contained in:
kimura 2022-04-15 17:22:28 +09:00
parent 13390f1298
commit 9eb3569047
4 changed files with 35 additions and 6 deletions

View File

@ -7374,6 +7374,7 @@ MonoBehaviour:
- {fileID: 758194584}
- {fileID: 278785268}
autoCookButton: {fileID: 249665956}
notifyIcon: {fileID: 3664916832445709977}
--- !u!1 &2124297503
GameObject:
m_ObjectHideFlags: 0
@ -7994,6 +7995,11 @@ PrefabInstance:
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6498465124467203549, guid: caaa748dbeed576499e8cae74d33f689,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6969874152703327186, guid: caaa748dbeed576499e8cae74d33f689,
type: 3}
propertyPath: m_AnchoredPosition.y
@ -8076,6 +8082,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: caaa748dbeed576499e8cae74d33f689, type: 3}
--- !u!1 &3664916832445709977 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6302295283707553864, guid: caaa748dbeed576499e8cae74d33f689,
type: 3}
m_PrefabInstance: {fileID: 3664916832445709976}
m_PrefabAsset: {fileID: 0}
--- !u!224 &3664916832445709978 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3664916832844628215, guid: caaa748dbeed576499e8cae74d33f689,

View File

@ -1104,6 +1104,7 @@ MonoBehaviour:
saleButton: {fileID: 3508757909112374925}
productManagementButton: {fileID: 4134779366559125937}
stockNotifyIcon: {fileID: 2430043917671370164}
kitchenNotifyIcon: {fileID: 4699855437215309545}
--- !u!1 &3310671341662576997
GameObject:
m_ObjectHideFlags: 0
@ -4080,15 +4081,15 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f8587bb162250fa48947d648e934781e, type: 3}
--- !u!224 &3233636912317429793 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 8136263580696535353, guid: f8587bb162250fa48947d648e934781e,
type: 3}
m_PrefabInstance: {fileID: 6632112567178762520}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2430043917671370164 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 9056949049436837036, guid: f8587bb162250fa48947d648e934781e,
type: 3}
m_PrefabInstance: {fileID: 6632112567178762520}
m_PrefabAsset: {fileID: 0}
--- !u!224 &3233636912317429793 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 8136263580696535353, guid: f8587bb162250fa48947d648e934781e,
type: 3}
m_PrefabInstance: {fileID: 6632112567178762520}
m_PrefabAsset: {fileID: 0}

View File

@ -16,6 +16,7 @@ namespace MyGame.Scenes.Main.Scripts
[SerializeField] private Animator cookAnimator;
[SerializeField] private GameObject[] progressImages;
[SerializeField] private Button autoCookButton;
[SerializeField] private GameObject notifyIcon;
public IObservable<Unit> Button => autoCookButton.OnClickAsObservable().TakeUntilDestroy(this);
private IDisposable timerDisposable;
@ -31,6 +32,18 @@ namespace MyGame.Scenes.Main.Scripts
SetProgress(0f);
}
public void CheckNotify()
{
notifyIcon.SetActive(CheckComplete());
}
public static bool CheckComplete()
{
var gameData = GameDataManager.GameData;
var remainingTime = DateTime.FromBinary(gameData.AutoCookFinishTime).Subtract(DateTime.UtcNow);
return gameData.AutoCookProducts.Length != 0 && remainingTime.TotalSeconds <= 0;
}
public void SetActive(bool active)
{
autoCookButton.gameObject.SetActive(active);

View File

@ -1,4 +1,5 @@
using System;
using MyGame.Scenes.Main.Scripts;
using MyGame.Scripts;
using UniRx;
using UnityEngine;
@ -13,6 +14,7 @@ public class FooterManager : MonoBehaviour
[SerializeField] private FooterButton saleButton;
[SerializeField] private FooterButton productManagementButton;
[SerializeField] private GameObject stockNotifyIcon;
[SerializeField] private GameObject kitchenNotifyIcon;
private void Start()
{
@ -37,6 +39,7 @@ public class FooterManager : MonoBehaviour
TransitionManager.Instance.LoadScene(x);
}).AddTo(this);
kitchenNotifyIcon.SetActive(AutoCookView.CheckComplete());
stockNotifyIcon.SetActive(Shopping.CheckEarnedRecipe());
}
}