Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Unity 遊戲事件
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本主題將說明如何在 Unity 遊戲中使用 Play 遊戲服務的事件。
事前準備
設定 Unity 專案和 Unity 適用的 Google Play 遊戲外掛程式。詳情請參閱入門指南。
建立事件
您需要在 Google Play 管理中心內建立事件。詳情請參閱 Play 遊戲服務的事件指南。建立事件後,請按照入門指南的說明將事件的 Android 資源加入外掛程式。
記錄事件
如果要按照累加原則處理事件,請呼叫以下方法:
using GooglePlayGames;
...
// Increments the event with Id "YOUR_EVENT_ID" by 1
PlayGamesPlatform.Instance.Events.IncrementEvent("YOUR_EVENT_ID", 1);
您只需要呼叫一次。這個方法會在背景處理批次和執行作業。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2026-03-17 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-03-17 (世界標準時間)。"],[],[]]