成就系统 巨大修改 新的ui 黑白效果 等一堆
This commit is contained in:
@@ -159,6 +159,85 @@ MonoBehaviour:
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u97F3\u4E50: artistName | \u66F2\u7ED8: painterName | \u5236\u8C31: charterName"
|
||||
--- !u!1 &683142711094714909
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4553002270050802252}
|
||||
- component: {fileID: 5067636407003327723}
|
||||
- component: {fileID: 3544928675621084937}
|
||||
m_Layer: 5
|
||||
m_Name: diff
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4553002270050802252
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 683142711094714909}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1613555900959276112}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -20, y: -28.1}
|
||||
m_SizeDelta: {x: 160, y: 22}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5067636407003327723
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 683142711094714909}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3544928675621084937
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 683142711094714909}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 775c674e81662c644b64550d2e8f74e0, type: 3}
|
||||
m_FontSize: 22
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 6
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "(\u6700\u9AD8\u5206\u6570\u96BE\u5EA6)"
|
||||
--- !u!1 &1198053886828452625
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -320,13 +399,34 @@ MonoBehaviour:
|
||||
joinTime_and_dlcName_Text: {fileID: 5869685068699755495}
|
||||
songOverallDescriptionText: {fileID: 2031114915171946668}
|
||||
highestScoreText: {fileID: 1132493786035819634}
|
||||
highestScoreDifficultyText: {fileID: 3544928675621084937}
|
||||
difficultyIDText: {fileID: 6948039996079800055}
|
||||
songIDText: {fileID: 6350822755597574453}
|
||||
buttonImage: {fileID: 4974503315116154840}
|
||||
scoreLevelImage: {fileID: 9222537835252028022}
|
||||
profileImage: {fileID: 7018466335066945843}
|
||||
song_songSerialID: 0
|
||||
selected_boarder: {fileID: 4758992877847013954}
|
||||
fade_image: {fileID: 8405752277710552670}
|
||||
easePercent: 1
|
||||
ssPercent: 0.95
|
||||
sPercent: 0.9
|
||||
aPercent: 0.8
|
||||
bPercent: 0.7
|
||||
cPercent: 0.6
|
||||
dPercent: 0.5
|
||||
ePercent: 0.4
|
||||
fPercent: 0.3
|
||||
easeSprite: {fileID: 21300000, guid: 1b7d3065f66d15b45b170444124b57ca, type: 3}
|
||||
ssSprite: {fileID: 21300000, guid: c218e48d1b0d49541bee4a99fffc738c, type: 3}
|
||||
sSprite: {fileID: 21300000, guid: 8f6b0c65c13b1ed478dd3f37e989f2c5, type: 3}
|
||||
aSprite: {fileID: 21300000, guid: 61dd84e2a30a06a4b913933e34767f4b, type: 3}
|
||||
bSprite: {fileID: 21300000, guid: ff77da93eaa5bdd44966dad03e35f56b, type: 3}
|
||||
cSprite: {fileID: 21300000, guid: a919404cd6477be4c878442426de1d13, type: 3}
|
||||
dSprite: {fileID: 21300000, guid: a3a60d742fbaa4b4081c9b4b73da8b96, type: 3}
|
||||
eSprite: {fileID: 21300000, guid: 698d2276a92e5754d9064e9e0c3494bf, type: 3}
|
||||
fSprite: {fileID: 21300000, guid: 37afeb5a99b12ff4995ab22436f2c8c5, type: 3}
|
||||
ufSprite: {fileID: 21300000, guid: dc19bff00a17ee14ebbb6bbedf411046, type: 3}
|
||||
minAlpha: 0
|
||||
maxAlpha: 0.25
|
||||
blinkDuration: 2
|
||||
@@ -1015,6 +1115,7 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2006200464526798236}
|
||||
- {fileID: 4553002270050802252}
|
||||
m_Father: {fileID: 5796882771854016848}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
@@ -1337,4 +1438,4 @@ MonoBehaviour:
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u5386\u53F2\u6700\u9AD8\u603B\u5206"
|
||||
m_Text: "\u6700\u9AD8\u603B\u5206"
|
||||
|
||||
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
|
||||
public class SongButton : MonoBehaviour
|
||||
{
|
||||
@@ -13,9 +14,11 @@ public class SongButton : MonoBehaviour
|
||||
public Text joinTime_and_dlcName_Text;
|
||||
public Text songOverallDescriptionText;
|
||||
public Text highestScoreText;
|
||||
public Text highestScoreDifficultyText;
|
||||
public Text difficultyIDText;
|
||||
public Text songIDText;
|
||||
public Image buttonImage;
|
||||
public Image scoreLevelImage;
|
||||
[Header("头图")]
|
||||
public Image profileImage;
|
||||
public int song_songSerialID;
|
||||
@@ -23,6 +26,28 @@ public class SongButton : MonoBehaviour
|
||||
public Image selected_boarder;
|
||||
public Image fade_image;
|
||||
|
||||
[Header("计数百分比")]
|
||||
public float easePercent = 1f;
|
||||
public float ssPercent = 0.95f;
|
||||
public float sPercent = 0.9f;
|
||||
public float aPercent = 0.8f;
|
||||
public float bPercent = 0.7f;
|
||||
public float cPercent = 0.6f;
|
||||
public float dPercent = 0.5f;
|
||||
public float ePercent = 0.4f;
|
||||
public float fPercent = 0.3f;
|
||||
[Header("阶段图")]
|
||||
public Sprite easeSprite;
|
||||
public Sprite ssSprite;
|
||||
public Sprite sSprite;
|
||||
public Sprite aSprite;
|
||||
public Sprite bSprite;
|
||||
public Sprite cSprite;
|
||||
public Sprite dSprite;
|
||||
public Sprite eSprite;
|
||||
public Sprite fSprite;
|
||||
public Sprite ufSprite;
|
||||
|
||||
[Header("Fade Image Settings")]
|
||||
public float minAlpha = 0f;
|
||||
public float maxAlpha = 1f;
|
||||
@@ -72,32 +97,122 @@ public class SongButton : MonoBehaviour
|
||||
songOverallDescriptionText.text = string.IsNullOrEmpty(sd.thisLevel_overallDescription) ? "暂无歌曲简介。" : sd.thisLevel_overallDescription;
|
||||
}
|
||||
|
||||
int bestTotal = 0;
|
||||
// Robust logic: compute best total across chartFiles if present
|
||||
int bestTotal = -1;
|
||||
int bestDiff = -1;
|
||||
if (sd.personalRecordMap != null)
|
||||
|
||||
if (sd.chartFiles != null && sd.chartFiles.Count > 0)
|
||||
{
|
||||
foreach (var kvp in sd.personalRecordMap)
|
||||
foreach (var entry in sd.chartFiles)
|
||||
{
|
||||
int diff = kvp.Key;
|
||||
int p = kvp.Value;
|
||||
int i = sd.GetIdolRecord(diff);
|
||||
int combined = p + i;
|
||||
if (combined > bestTotal)
|
||||
if (entry == null) continue;
|
||||
int total = 0;
|
||||
// prefer stored total if > 0
|
||||
if (entry.totalPersonalRecordForThisDifficulty > 0)
|
||||
{
|
||||
bestTotal = combined;
|
||||
bestDiff = diff;
|
||||
total = entry.totalPersonalRecordForThisDifficulty;
|
||||
}
|
||||
else
|
||||
{
|
||||
// else compute from entry fields
|
||||
int p = entry.chartPersonalRecordForThisDifficulty;
|
||||
int i = entry.idolPersonalRecordForThisDifficulty;
|
||||
total = p + i;
|
||||
|
||||
// as fallback also check SongData maps
|
||||
if (total == 0 && sd.personalRecordMap != null)
|
||||
{
|
||||
int pm = sd.personalRecordMap.ContainsKey(entry.difficulty) ? sd.personalRecordMap[entry.difficulty] : 0;
|
||||
int im = sd.idolRecordMap != null && sd.idolRecordMap.ContainsKey(entry.difficulty) ? sd.idolRecordMap[entry.difficulty] : 0;
|
||||
total = pm + im;
|
||||
}
|
||||
}
|
||||
|
||||
if (bestDiff == -1 || total > bestTotal)
|
||||
{
|
||||
bestTotal = total;
|
||||
bestDiff = entry.difficulty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If still not found, fallback to maps
|
||||
if (bestDiff == -1)
|
||||
{
|
||||
if (sd.personalRecordMap != null)
|
||||
{
|
||||
foreach (var kvp in sd.personalRecordMap)
|
||||
{
|
||||
int diff = kvp.Key;
|
||||
int p = kvp.Value;
|
||||
int i = sd.GetIdolRecord(diff);
|
||||
int combined = p + i;
|
||||
if (bestDiff == -1 || combined > bestTotal)
|
||||
{
|
||||
bestTotal = combined;
|
||||
bestDiff = diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// final fallback
|
||||
if (bestDiff == -1)
|
||||
{
|
||||
bestTotal = sd.personalRecord;
|
||||
bestDiff = sd.thisLevel_selectedDifficultyID;
|
||||
}
|
||||
|
||||
if (bestTotal < 0) bestTotal = 0;
|
||||
|
||||
if (highestScoreText != null) highestScoreText.text = bestTotal.ToString();
|
||||
|
||||
// Map difficulty index to label and set highestScoreDifficultyText as (Label)
|
||||
if (highestScoreDifficultyText != null)
|
||||
{
|
||||
string label = "";
|
||||
switch (bestDiff)
|
||||
{
|
||||
case 0: label = "(Easy)"; break;
|
||||
case 1: label = "(Hard)"; break;
|
||||
case 2: label = "(Incredible)"; break;
|
||||
case 3: label = "(Impossible)"; break;
|
||||
default: label = ""; break;
|
||||
}
|
||||
highestScoreDifficultyText.text = label;
|
||||
}
|
||||
|
||||
// Assign scoreLevelImage based on thresholds relative to 2,000,000
|
||||
if (scoreLevelImage != null)
|
||||
{
|
||||
Sprite chosenSprite = null;
|
||||
float baseScore = 2000000f;
|
||||
// Evaluate from top to bottom thresholds
|
||||
if (bestTotal >= baseScore * easePercent && easeSprite != null)
|
||||
chosenSprite = easeSprite;
|
||||
else if (bestTotal >= baseScore * ssPercent && ssSprite != null)
|
||||
chosenSprite = ssSprite;
|
||||
else if (bestTotal >= baseScore * sPercent && sSprite != null)
|
||||
chosenSprite = sSprite;
|
||||
else if (bestTotal >= baseScore * aPercent && aSprite != null)
|
||||
chosenSprite = aSprite;
|
||||
else if (bestTotal >= baseScore * bPercent && bSprite != null)
|
||||
chosenSprite = bSprite;
|
||||
else if (bestTotal >= baseScore * cPercent && cSprite != null)
|
||||
chosenSprite = cSprite;
|
||||
else if (bestTotal >= baseScore * dPercent && dSprite != null)
|
||||
chosenSprite = dSprite;
|
||||
else if (bestTotal >= baseScore * ePercent && eSprite != null)
|
||||
chosenSprite = eSprite;
|
||||
else if (bestTotal >= baseScore * fPercent && fSprite != null)
|
||||
chosenSprite = fSprite;
|
||||
else if (ufSprite != null)
|
||||
chosenSprite = ufSprite;
|
||||
|
||||
if (chosenSprite != null)
|
||||
scoreLevelImage.sprite = chosenSprite;
|
||||
}
|
||||
|
||||
// Determine displayed difficulty: show the highest difficultyLEVEL present in chartFiles (if any)
|
||||
string diffDisplay = "0";
|
||||
if (sd.chartFiles != null && sd.chartFiles.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user