販売試食看板の表示条件修正
This commit is contained in:
parent
16cb145eba
commit
077c0468f1
|
|
@ -226,6 +226,9 @@ public class MarketManager : MonoBehaviour
|
|||
SetShopView(state);
|
||||
}).AddTo(this);
|
||||
|
||||
// 試食看板はStart時非表示
|
||||
signBoardView.SetActiveTastingBoard(false);
|
||||
|
||||
// 宣伝ボタン/試食表示切替
|
||||
var tastingComplete = new Subject<Unit>().AddTo(this);
|
||||
market.CurrentShopState
|
||||
|
|
@ -244,6 +247,7 @@ public class MarketManager : MonoBehaviour
|
|||
else if (gameData.TastingCount > 0)
|
||||
{
|
||||
rewardButtonView.gameObject.SetActive(false);
|
||||
// 試食表示
|
||||
signBoardView.SetActiveTastingBoard(true);
|
||||
BrotherPinkView.Instance.StartTasting();
|
||||
BrotherPinkView.Instance.SetTastingCount(gameData.TastingCount);
|
||||
|
|
@ -257,18 +261,17 @@ public class MarketManager : MonoBehaviour
|
|||
BrotherPinkView.Instance.StopTasting();
|
||||
});
|
||||
}
|
||||
else
|
||||
else // 宣伝も試食も未発動
|
||||
{
|
||||
BrotherPinkView.Instance.StopTasting();
|
||||
rewardButtonView.gameObject.SetActive(true);
|
||||
signBoardView.SetActiveTastingBoard(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
else // 閉店
|
||||
{
|
||||
BrotherPinkView.Instance.StopTasting();
|
||||
rewardButtonView.gameObject.SetActive(false);
|
||||
signBoardView.SetActiveTastingBoard(false);
|
||||
signBoardView.CancelTasting();
|
||||
}
|
||||
}).AddTo(this);
|
||||
// CombineLatest動かすのに必要
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ namespace MyGame.Scenes.marketing.Scripts
|
|||
{
|
||||
public class MarketSignBoardView : MonoBehaviour
|
||||
{
|
||||
private static readonly string remainTimeFormat = "残り{0:D2}:{1:D2}";
|
||||
private static readonly string RemainTimeFormat = "残り{0:D2}:{1:D2}";
|
||||
private static readonly string TimeUpText = "終了";
|
||||
[SerializeField] private Text remainTimeText;
|
||||
[SerializeField] private GameObject normalBoardObject;
|
||||
[SerializeField] private GameObject tastingBoardObject;
|
||||
|
|
@ -23,7 +24,7 @@ namespace MyGame.Scenes.marketing.Scripts
|
|||
private void SetTime(int seconds)
|
||||
{
|
||||
seconds = Mathf.Max(0, seconds);
|
||||
remainTimeText.text = string.Format(remainTimeFormat, Mathf.Min(seconds / 60, 99), seconds % 60);
|
||||
remainTimeText.text = string.Format(RemainTimeFormat, Mathf.Min(seconds / 60, 99), seconds % 60);
|
||||
}
|
||||
|
||||
public void SetTimer(int remaining, Action onInterval = null, Action onComplete = null)
|
||||
|
|
@ -38,8 +39,15 @@ namespace MyGame.Scenes.marketing.Scripts
|
|||
onInterval?.Invoke();
|
||||
}, () =>
|
||||
{
|
||||
remainTimeText.text = TimeUpText;
|
||||
onComplete?.Invoke();
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
||||
public void CancelTasting()
|
||||
{
|
||||
timerDispose?.Dispose();
|
||||
remainTimeText.text = TimeUpText;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue