多轮审查和修复
This commit is contained in:
54
Assets/Scripts/Support/Platform/IPlatformService.cs
Normal file
54
Assets/Scripts/Support/Platform/IPlatformService.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BaseGames.Platform
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台服务抽象接口(架构 16_SupportingModules §3)。
|
||||
/// 解耦游戏逻辑与平台 SDK(Steam / Console / Mobile)。
|
||||
/// </summary>
|
||||
public interface IPlatformService
|
||||
{
|
||||
// ── 初始化 / 生命周期 ──────────────────────────────────────────────────
|
||||
bool IsInitialized { get; }
|
||||
Task<bool> InitializeAsync();
|
||||
/// <summary>每帧调用(由 PlatformBootstrap.Update 驱动),处理 SDK 回调。</summary>
|
||||
void RunCallbacks();
|
||||
void Shutdown();
|
||||
|
||||
// ── 成就 ──────────────────────────────────────────────────────────────
|
||||
void UnlockAchievement(string achievementId);
|
||||
void ClearAchievement(string achievementId);
|
||||
Task<bool> IsAchievementUnlocked(string achievementId);
|
||||
|
||||
// ── 统计数据(Steam 成就进度跟踪)────────────────────────────────────
|
||||
void SetStat(string statId, int value);
|
||||
void IncrementStat(string statId, int increment = 1);
|
||||
int GetStat(string statId);
|
||||
|
||||
// ── 云存档 ────────────────────────────────────────────────────────────
|
||||
bool IsCloudAvailable { get; }
|
||||
Task<bool> CloudSaveAsync(string fileName, byte[] data);
|
||||
Task<byte[]> CloudLoadAsync(string fileName);
|
||||
|
||||
// ── Rich Presence ─────────────────────────────────────────────────────
|
||||
void SetRichPresence(string key, string value);
|
||||
void ClearRichPresence();
|
||||
|
||||
// ── 排行榜 ────────────────────────────────────────────────────────────
|
||||
void SubmitLeaderboardScore(string boardId, long score);
|
||||
Task<LeaderboardEntry[]> GetLeaderboardEntries(string boardId, int maxCount);
|
||||
|
||||
// ── DLC / 商城 ────────────────────────────────────────────────────────
|
||||
bool IsDLCOwned(string dlcId);
|
||||
|
||||
// ── 覆盖层(Steam Overlay 等)─────────────────────────────────────────
|
||||
void ShowOverlay(string dialog);
|
||||
}
|
||||
|
||||
public struct LeaderboardEntry
|
||||
{
|
||||
public string PlayerName;
|
||||
public long Score;
|
||||
public int Rank;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user