original ver 25/06/01
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class SongDataSerializable
|
||||
{
|
||||
public string usernameID;
|
||||
public string songName;
|
||||
public int songID;
|
||||
public int songLength_second;
|
||||
public string artistName;
|
||||
public string painter;
|
||||
public string level_creator;
|
||||
public string belongsTo_whichDLC;
|
||||
|
||||
public int bpm;
|
||||
public float songDuration;
|
||||
|
||||
public int game_enterTimes;
|
||||
public int time_totalPlayingTime;
|
||||
public string uploadData;
|
||||
|
||||
public int difficultyID;
|
||||
public float current_levelProgress;
|
||||
public bool _if_level_is_EASE;
|
||||
public int max_comboRecord;
|
||||
|
||||
public int personalRecord; // 存储全局最高分
|
||||
public Dictionary<int, int> difficultyNumberMap = new Dictionary<int, int>();
|
||||
public Dictionary<int, int> personalRecordMap = new Dictionary<int, int>();
|
||||
public Dictionary<int, string> chartFileMap = new Dictionary<int, string>();
|
||||
|
||||
public SongDataSerializable(SongData songData)
|
||||
{
|
||||
usernameID = songData.usernameID;
|
||||
songName = songData.songName;
|
||||
songID = songData.songID;
|
||||
songLength_second = songData.songLength_second;
|
||||
artistName = songData.artistName;
|
||||
painter = songData.painter;
|
||||
level_creator = songData.level_creator;
|
||||
belongsTo_whichDLC = songData.belongsTo_whichDLC;
|
||||
|
||||
bpm = songData.bpm;
|
||||
songDuration = songData.songDuration;
|
||||
|
||||
game_enterTimes = songData.game_enterTimes;
|
||||
time_totalPlayingTime = songData.time_totalPlayingTime;
|
||||
uploadData = songData.uploadData.ToString();
|
||||
|
||||
difficultyID = songData.difficultyID;
|
||||
current_levelProgress = songData.current_levelProgress;
|
||||
_if_level_is_EASE = songData._if_level_is_EASE;
|
||||
max_comboRecord = songData.max_comboRecord;
|
||||
|
||||
difficultyNumberMap = songData.difficultyNumberMap;
|
||||
personalRecordMap = songData.personalRecordMap;
|
||||
personalRecord = songData.personalRecord; // 存储全局最高分
|
||||
|
||||
chartFileMap = new Dictionary<int, string>();
|
||||
/*foreach (var kvp in songData.chartFileMap)
|
||||
{
|
||||
if (songData.chartFileMap == null) return;
|
||||
chartFileMap[kvp.Key] = kvp.Value ? kvp.Value.name : "";
|
||||
}*/
|
||||
}
|
||||
|
||||
public void ApplyTo(SongData songData)
|
||||
{
|
||||
songData.usernameID = usernameID;
|
||||
songData.songName = songName;
|
||||
songData.songID = songID;
|
||||
songData.songLength_second = songLength_second;
|
||||
songData.artistName = artistName;
|
||||
songData.painter = painter;
|
||||
songData.level_creator = level_creator;
|
||||
songData.belongsTo_whichDLC = belongsTo_whichDLC;
|
||||
|
||||
songData.bpm = bpm;
|
||||
songData.songDuration = songDuration;
|
||||
|
||||
songData.game_enterTimes = game_enterTimes;
|
||||
songData.time_totalPlayingTime = time_totalPlayingTime;
|
||||
songData.uploadData = DateTime.Parse(uploadData);
|
||||
|
||||
songData.difficultyID = difficultyID;
|
||||
songData.current_levelProgress = current_levelProgress;
|
||||
songData._if_level_is_EASE = _if_level_is_EASE;
|
||||
songData.max_comboRecord = max_comboRecord;
|
||||
|
||||
songData.difficultyNumberMap = difficultyNumberMap;
|
||||
songData.personalRecordMap = personalRecordMap;
|
||||
songData.personalRecord = personalRecord; // 赋值全局最高分
|
||||
|
||||
foreach (var kvp in chartFileMap)
|
||||
{
|
||||
songData.chartFileMap[kvp.Key] = Resources.Load<TextAsset>("Charts/" + kvp.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user