リザルトUI調整
This commit is contained in:
parent
c70b27b4cb
commit
38c02e8877
|
|
@ -1114,8 +1114,8 @@ MonoBehaviour:
|
|||
materialImage: {fileID: 5034752974552429102}
|
||||
materialAmountText: {fileID: 5034752974931089885}
|
||||
detailOffset: 250
|
||||
progressDuration: 2
|
||||
waitButtonActive: 2
|
||||
progressDuration: 1.5
|
||||
waitButtonActive: 3
|
||||
waitProgress: 1.5
|
||||
--- !u!1 &5034752975247083714
|
||||
GameObject:
|
||||
|
|
|
|||
|
|
@ -25,10 +25,16 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
[SerializeField] private float waitButtonActive = .5f;
|
||||
[SerializeField] private float waitProgress = .5f;
|
||||
private float progressValue;
|
||||
private Vector3 defaultDetailObjectPos;
|
||||
|
||||
public IObservable<Unit> OnRetry => retryButton.OnClickAsObservable().TakeUntilDestroy(this);
|
||||
public IObservable<Unit> OnClose => closeButton.OnClickAsObservable().TakeUntilDestroy(this);
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
defaultDetailObjectPos = detailObject.transform.localPosition;
|
||||
}
|
||||
|
||||
public void ShowResult(int score, ScrollGamePlaceData[] placeList, ScrollGameStageData stageData)
|
||||
{
|
||||
var gameData = GameDataManager.GameData;
|
||||
|
|
@ -62,7 +68,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
foreach (var placeData in placeList.Where(data => data.itemId != 0))
|
||||
{
|
||||
var amount = Mathf.FloorToInt((float)score / placeData.needScore);
|
||||
var shopData = shopDataList.FirstOrDefault(data => data.itemId == placeData.itemId);
|
||||
var shopData = shopDataList.FirstOrDefault(data => data.itemId == placeData.itemId && data.Category == ItemCategory.Material);
|
||||
materialNameText.text = shopData.Name;
|
||||
// materialImage
|
||||
materialAmountText.text = $"x{amount}";
|
||||
|
|
@ -73,6 +79,9 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
.OrderBy(data => data.needScore)
|
||||
// .Where(data => !gameData.MyRecipes.Contains(data.recipeId))
|
||||
.FirstOrDefault(data => data.recipeId != 0);
|
||||
#if UNITY_EDITOR
|
||||
recipePlaceData = prevPlaceScore < recipePlaceData.needScore ? recipePlaceData : null;
|
||||
#endif
|
||||
if (recipePlaceData != null && placeScoreData.Score >= recipePlaceData.needScore)
|
||||
{
|
||||
if (!gameData.MyRecipes.Contains(recipePlaceData.recipeId))
|
||||
|
|
@ -89,19 +98,25 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
detailObject.SetActive(true);
|
||||
|
||||
// 商品獲得済みならレシピ非表示
|
||||
if (prevPlaceScore >= recipePlaceData.needScore)
|
||||
// if (recipePlaceData is null)
|
||||
if (recipePlaceData is null)
|
||||
{
|
||||
// detailの表示位置変更
|
||||
detailObject.transform.SetLocalPositionY(detailOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
detailObject.transform.SetLocalPositionY(defaultDetailObjectPos.y);
|
||||
meterObject.SetActive(true);
|
||||
SetProgress((float)prevPlaceScore / recipePlaceData.needScore, false);
|
||||
this.CallWaitForSeconds(waitProgress, () =>
|
||||
{
|
||||
SetProgress((float)placeScoreData.Score / recipePlaceData.needScore);
|
||||
SetProgress((float)placeScoreData.Score / recipePlaceData.needScore, true, () =>
|
||||
{
|
||||
if (placeScoreData.Score >= recipePlaceData.needScore)
|
||||
{
|
||||
ShopItemExchangeView.ShowDialog(shopDataList.FirstOrDefault(data => data.itemId == recipePlaceData.recipeId && data.Category == ItemCategory.Recipe));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.CallWaitForSeconds(waitButtonActive, () =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue