Achievements
Important
Before using any platform features, developers have to initialize Platform SDK first. Refer to Platform for more information.
Integrating Achievements
Once you’re finished creating the achievements, you can integrate them in your game. When you call the functions in this section, make sure to use the achievement name you specified on the developer dashboard.
YVR.Platform.GetDefinitionsByName
: Retrieves information about a specific achievement, including achievement name, type, and target or bitfield length.YVR.Platform. GetProgressByName
: Retrieves information about a user’s progress on a specific achievement, including name, unlocked status, time that the achievement unlocked, current bitfield, and current count.YVR.Platform.GetAllDefinitions
: Retrieves information about all achievements, including achievement name, type, and target or bitfield length.YVR.Platform.GetAllProgress
: Retrieves information about a user’s progress on all achievements, including name, unlocked status, time that achievement unlocked, current bitfield, and current count.
The following SDK methods can be called for any achievement that has a Client Authoritative write policy.
YVR.Platform.UnlockAchievement
: Unlock a specified achievement. This will completely unlock an achievement, including count and bitfield achievements, even if the target has not met.YVR.Platform.AchievementAddCount
: Increment the count on a Count achievement.YVR.Platform.AchievementAddFields
: Unlock a bit in a Bitfield type achievement.
Note
For more information, please refer to Achievement API Documentation.
Sample
Important
YVR system version requirement: 1.2.6 and above
Platform Sample is also available at PlayForDreamDevelopers Github.
Under Project panel, go to Assets > Samples > Achievement folder to view the sample project.
Build and install on YVR device.