Social.LoadAchievementDescriptions

切换到手册
public static void LoadAchievementDescriptions (Action<IAchievementDescription[]> callback);

描述

加载与此应用程序关联的成就描述。

这通常是在 Unity 外部在实现提供程序提供的某个外部服务上设置的。例如,在使用 GameCenter 时,您需要使用 iTunes Connect 设置成就。

using UnityEngine;
using UnityEngine.SocialPlatforms;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { Social.LoadAchievementDescriptions(descriptions => { if (descriptions.Length > 0) { Debug.Log("Got " + descriptions.Length + " achievement descriptions"); string achievementDescriptions = "Achievement Descriptions:\n"; foreach (IAchievementDescription ad in descriptions) { achievementDescriptions += "\t" + ad.id + " " + ad.title + " " + ad.unachievedDescription + "\n"; } Debug.Log(achievementDescriptions); } else Debug.Log("Failed to load achievement descriptions"); }); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961