修复小问题 结算装了一点
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class settlementController : MonoBehaviour
|
||||
{
|
||||
[Header("文本")]
|
||||
[Header("结算界面之爹")]
|
||||
[SerializeField] private BeatmapManager bmm;
|
||||
[SerializeField] private ScoreManager sm;
|
||||
private SongData thisSong_so;
|
||||
private int maxScore_sum = 2000000;
|
||||
[Header("跳转之按钮")]
|
||||
public Button exit_toSelectSongs;
|
||||
public Button replay_thisGame;
|
||||
public Button display_rankList;
|
||||
public Button share_toSocialMedia;
|
||||
|
||||
[Header("文本和进度条")]
|
||||
public Text songName_Text;
|
||||
[Tooltip("当前关卡的进度百分比")]
|
||||
public Text thisLevel_currentPercentage_Text;
|
||||
@@ -12,6 +24,8 @@ public class settlementController : MonoBehaviour
|
||||
public Text pmScoreSum_Text;
|
||||
public Text idolScoreSum_Text;
|
||||
|
||||
public Image thisLevel_progressBar_Image;
|
||||
|
||||
[Header("奖励内容信息")]
|
||||
public Text reward_playerEXP_Text;
|
||||
public Text reward_money_Text;
|
||||
@@ -20,16 +34,61 @@ public class settlementController : MonoBehaviour
|
||||
[Header("给多少钱")]
|
||||
[SerializeField] private long moneyToGive_thisLevel;
|
||||
|
||||
// 得到音符统计
|
||||
[Header("击打情况统计")]
|
||||
public Text perfectHitCount_Text;
|
||||
public Text perfectHitPercent_Text;
|
||||
public Image perfect_barFill_Image;
|
||||
|
||||
public Text greatHitCount_Text;
|
||||
public Text greatHitPercent_Text;
|
||||
public Image great_barFill_Image;
|
||||
|
||||
public Text goodHitCount_Text;
|
||||
public Text goodHitPercent_Text;
|
||||
public Image good_barFill_Image;
|
||||
|
||||
public Text missHitCount_Text;
|
||||
public Text missHitPercent_Text;
|
||||
public Image miss_barFill_Image;
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
void getThisSong_info()
|
||||
{
|
||||
|
||||
thisSong_so = bmm.assignedSongData;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
public void startSettlement_uiUpdate()
|
||||
{
|
||||
getThisSong_info();
|
||||
if(!sm)
|
||||
{
|
||||
songName_Text.text = bmm.parsedTitle;
|
||||
|
||||
finalScore_Text.text = (sm.allSum_pmScore + sm.allSum_idolScore).ToString();
|
||||
pmScoreSum_Text.text = sm.allSum_pmScore.ToString();
|
||||
idolScoreSum_Text.text = sm.allSum_idolScore.ToString();
|
||||
thisLevel_currentPercentage_Text.text = ((float)(sm.allSum_pmScore + sm.allSum_idolScore) / maxScore_sum * 100).ToString("F2") + "%";
|
||||
thisLevel_progressBar_Image.fillAmount = (float)(sm.allSum_pmScore + sm.allSum_idolScore) / maxScore_sum;
|
||||
|
||||
int noteCountSum = sm.countPerfect + sm.countGreat + sm.countGood + sm.countMiss;
|
||||
|
||||
perfectHitCount_Text.text = sm.countPerfect.ToString();
|
||||
greatHitCount_Text.text = sm.countGreat.ToString();
|
||||
goodHitCount_Text.text = sm.countGood.ToString();
|
||||
missHitCount_Text.text = sm.countMiss.ToString();
|
||||
|
||||
perfect_barFill_Image.fillAmount = (float)sm.countPerfect / noteCountSum;
|
||||
great_barFill_Image.fillAmount = (float)sm.countGreat / noteCountSum;
|
||||
good_barFill_Image.fillAmount = (float)sm.countGood / noteCountSum;
|
||||
miss_barFill_Image.fillAmount = (float)sm.countMiss / noteCountSum;
|
||||
|
||||
perfectHitPercent_Text.text = ((float)sm.countPerfect / noteCountSum * 100).ToString("F1") + "%";
|
||||
greatHitPercent_Text.text = ((float)sm.countGreat / noteCountSum * 100).ToString("F1") + "%";
|
||||
goodHitPercent_Text.text = ((float)sm.countGood / noteCountSum * 100).ToString("F1") + "%";
|
||||
missHitPercent_Text.text = ((float)sm.countMiss / noteCountSum * 100).ToString("F1") + "%";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user