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