任务系统一半多,商城筛选功能,一些细节和免费包
This commit is contained in:
@@ -1636,6 +1636,16 @@ public class GameManager : MonoBehaviour
|
||||
/// Records the elapsed play time since the session started and adds it to the song's total play time.
|
||||
/// Can be called multiple times, but only records once per session.
|
||||
/// </summary>
|
||||
public float GetPendingSessionDurationSeconds()
|
||||
{
|
||||
if (timeRecorded || currentSong == null || GameConfig.autoPlayEnabled)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
return Mathf.Max(0f, Time.realtimeSinceStartup - sessionStartTime);
|
||||
}
|
||||
|
||||
public void RecordTotalPlayTime()
|
||||
{
|
||||
if (timeRecorded || currentSong == null || GameConfig.autoPlayEnabled) return;
|
||||
|
||||
@@ -265,8 +265,9 @@ public class settlementController : MonoBehaviour
|
||||
getThisSong_info();
|
||||
|
||||
// --- Statistics: Record total play time at settlement ---
|
||||
if (gm != null) gm.RecordTotalPlayTime();
|
||||
else { var activeGM = FindAnyObjectByType<GameManager>(); if (activeGM != null) activeGM.RecordTotalPlayTime(); }
|
||||
GameManager runtimeGameManager = gm != null ? gm : FindAnyObjectByType<GameManager>();
|
||||
float sessionDurationForTasks = runtimeGameManager != null ? runtimeGameManager.GetPendingSessionDurationSeconds() : 0f;
|
||||
if (runtimeGameManager != null) runtimeGameManager.RecordTotalPlayTime();
|
||||
|
||||
// Documentation text normalized.
|
||||
PrepareSettlementMusic();
|
||||
@@ -314,6 +315,21 @@ public class settlementController : MonoBehaviour
|
||||
targetGoodCount * good_weight +
|
||||
targetMissCount * miss_weight) / noteCountSum * 100f);
|
||||
|
||||
if (!GameConfig.autoPlayEnabled)
|
||||
{
|
||||
DailyTaskEventHub.ReportPlaySong();
|
||||
DailyTaskEventHub.ReportTotalScore(targetTotalScore);
|
||||
if (targetMissCount <= 0 && noteCountRaw > 0)
|
||||
{
|
||||
DailyTaskEventHub.ReportFullCombo();
|
||||
}
|
||||
|
||||
if (sessionDurationForTasks > 0f)
|
||||
{
|
||||
DailyTaskEventHub.ReportGameDuration(sessionDurationForTasks);
|
||||
}
|
||||
}
|
||||
|
||||
perfectHitCount_Text.text = targetPerfectCount.ToString();
|
||||
greatHitCount_Text.text = targetGreatCount.ToString();
|
||||
goodHitCount_Text.text = targetGoodCount.ToString();
|
||||
|
||||
Reference in New Issue
Block a user