using Oculus.Platform.Models; using UnityEngine; namespace Oculus.Platform { public static class Achievements { public static Request AddCount(string name, ulong count) { if (Core.IsInitialized()) { return new Request(CAPI.ovr_Achievements_AddCount(name, count)); } return null; } public static Request AddFields(string name, string fields) { if (Core.IsInitialized()) { return new Request(CAPI.ovr_Achievements_AddFields(name, fields)); } return null; } public static Request GetAllDefinitions() { if (Core.IsInitialized()) { return new Request(CAPI.ovr_Achievements_GetAllDefinitions()); } return null; } public static Request GetAllProgress() { if (Core.IsInitialized()) { return new Request(CAPI.ovr_Achievements_GetAllProgress()); } return null; } public static Request GetDefinitionsByName(string[] names) { if (Core.IsInitialized()) { return new Request(CAPI.ovr_Achievements_GetDefinitionsByName(names, (names != null) ? names.Length : 0)); } return null; } public static Request GetProgressByName(string[] names) { if (Core.IsInitialized()) { return new Request(CAPI.ovr_Achievements_GetProgressByName(names, (names != null) ? names.Length : 0)); } return null; } public static Request Unlock(string name) { if (Core.IsInitialized()) { return new Request(CAPI.ovr_Achievements_Unlock(name)); } return null; } public static Request GetNextAchievementDefinitionListPage(AchievementDefinitionList list) { if (!list.HasNextPage) { Debug.LogWarning("Oculus.Platform.GetNextAchievementDefinitionListPage: List has no next page"); return null; } if (Core.IsInitialized()) { return new Request(CAPI.ovr_HTTP_GetWithMessageType(list.NextUrl, 712888917)); } return null; } public static Request GetNextAchievementProgressListPage(AchievementProgressList list) { if (!list.HasNextPage) { Debug.LogWarning("Oculus.Platform.GetNextAchievementProgressListPage: List has no next page"); return null; } if (Core.IsInitialized()) { return new Request(CAPI.ovr_HTTP_GetWithMessageType(list.NextUrl, 792913703)); } return null; } } }