Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bu konuda, Unity oyunlarında Play Oyun Hizmetleri başarılarının nasıl kullanılacağı açıklanmaktadır. Bu kılavuzda, Başlangıç kılavuzunda açıklandığı gibi projenizi ve Unity için Google Play Games eklentisini ayarladığınız varsayılır.
Başarı oluşturma
Projenizi ve eklentinizi ayarlarken Google Play Console'da başarıları oluşturun, ardından eklentiyi başarılarınızın Android kaynaklarıyla güncelleyin. Play Console'da başarı oluşturma hakkında ayrıntılı bilgi için başarılar kılavuzuna bakın.
Başarıları gösterme ve kilidini açma
Bir başarıyı açmak için Social.ReportProgress yöntemini 100.0f ilerleme değeriyle kullanın:
usingGooglePlayGames;usingUnityEngine.SocialPlatforms;...// unlock achievement (achievement ID "Cfjewijawiu_QA")Social.ReportProgress("Cfjewijawiu_QA",100.0f,(boolsuccess)=>{// handle success or failure});
Social.ReportProgress'in beklenen davranışına göre, 0,0f değeri başarının gösterildiği, 100,0f değeri ise başarının kilidinin açıldığı anlamına gelir.
Daha önce gizlenmiş bir başarıyı kilidini açmadan göstermek için Social.ReportProgress işlevini 0.0f değeriyle çağırın.
Başarıyı artırma
Başarı artımlıysa Social.ReportProgress'in Play Games uygulaması, Unity'nin sosyal API'sine göre beklenen davranışa uymaya çalışır. Ancak davranış aynı olmayabilir. Bu nedenle, artımlı başarılar için Social.ReportProgress'i kullanmamanızı öneririz. Bunun yerine, Play Games uzantısı olan PlayGamesPlatform.IncrementAchievement yöntemini kullanın.
usingGooglePlayGames;usingUnityEngine.SocialPlatforms;...// increment achievement (achievement ID "Cfjewijawiu_QA") by 5 stepsPlayGamesPlatform.Instance.IncrementAchievement("Cfjewijawiu_QA",5,(boolsuccess)=>{// handle success or failure});
Başarılar kullanıcı arayüzünü gösterme
Tüm başarılar için yerleşik kullanıcı arayüzünü göstermek üzere Social.ShowAchievementsUI'ı çağırın.
usingGooglePlayGames;usingUnityEngine.SocialPlatforms;...// show achievements UISocial.ShowAchievementsUI();
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-27 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-27 UTC."],[],[],null,["# Achievements in Unity games\n\nThis topic describes how to use Play Games Services achievements in Unity\ngames. It assumes that you've set up your project and the\nGoogle Play Games plugin for Unity, as discussed in the\n[Get started guide](/games/pgs/unity/unity-start).\n\nCreate an achievement\n---------------------\n\nWhen you set up your project and plugin, create the achievements in\nGoogle Play Console and then update the plugin with the Android resources\nfor your achievements. For details about creating achievements in\nPlay Console, see the\n[achievements guide](/games/pgs/achievements#create_an_achievement).\n\nReveal and unlock an achievement\n--------------------------------\n\nTo unlock an achievement, use the **Social.ReportProgress** method with a\nprogress value of 100.0f: \n\n using GooglePlayGames;\n using UnityEngine.SocialPlatforms;\n ...\n // unlock achievement (achievement ID \"Cfjewijawiu_QA\")\n Social.ReportProgress(\"Cfjewijawiu_QA\", 100.0f, (bool success) =\u003e {\n // handle success or failure\n });\n\nAccording to the expected behavior of\n[Social.ReportProgress](http://docs.unity3d.com/Documentation/ScriptReference/Social.ReportProgress.html),\na value of 0.0f means the achievement is revealed and a progress of 100.0f\nmeans the achievement is unlocked.\n\nTo reveal an achievement that was\npreviously hidden without unlocking it, call **Social.ReportProgress** with\na value of 0.0f.\n\nIncrement an achievement\n------------------------\n\nIf the achievement is incremental, the Play Games implementation of\n**Social.ReportProgress** will try to adhere to the\nexpected behavior according to Unity's social API. The behavior might not be\nidentical, though, so we recommend that you don't use **Social.ReportProgress**\nfor incremental achievements. Instead, use the\n[PlayGamesPlatform.IncrementAchievement](/games/services/unity/v2/api/class/google-play-games/play-games-platform#incrementachievement) method, which is a\nPlay Games extension. \n\n using GooglePlayGames;\n using UnityEngine.SocialPlatforms;\n ...\n // increment achievement (achievement ID \"Cfjewijawiu_QA\") by 5 steps\n PlayGamesPlatform.Instance.IncrementAchievement(\n \"Cfjewijawiu_QA\", 5, (bool success) =\u003e {\n // handle success or failure\n });\n\nShow the achievements UI\n------------------------\n\nTo show the built-in UI for all achievements, call\n**Social.ShowAchievementsUI**. \n\n using GooglePlayGames;\n using UnityEngine.SocialPlatforms;\n ...\n // show achievements UI\n Social.ShowAchievementsUI();"]]