123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- #if UNITY_ANDROID
- namespace GooglePlayGames.BasicApi
- {
- using System;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public class Achievement
- {
- static readonly DateTime UnixEpoch =
- new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
- private string mId = string.Empty;
- private bool mIsIncremental = false;
- private bool mIsRevealed = false;
- private bool mIsUnlocked = false;
- private int mCurrentSteps = 0;
- private int mTotalSteps = 0;
- private string mDescription = string.Empty;
- private string mName = string.Empty;
- private long mLastModifiedTime = 0;
- private ulong mPoints;
- private string mRevealedImageUrl;
- private string mUnlockedImageUrl;
-
-
-
-
- public override string ToString()
- {
- return string.Format(
- "[Achievement] id={0}, name={1}, desc={2}, type={3}, revealed={4}, unlocked={5}, steps={6}/{7}",
- mId, mName, mDescription, mIsIncremental ? "INCREMENTAL" : "STANDARD",
- mIsRevealed, mIsUnlocked, mCurrentSteps, mTotalSteps);
- }
- public Achievement()
- {
- }
-
-
-
- public bool IsIncremental
- {
- get { return mIsIncremental; }
- set { mIsIncremental = value; }
- }
-
-
-
- public int CurrentSteps
- {
- get { return mCurrentSteps; }
- set { mCurrentSteps = value; }
- }
-
-
-
- public int TotalSteps
- {
- get { return mTotalSteps; }
- set { mTotalSteps = value; }
- }
-
-
-
- public bool IsUnlocked
- {
- get { return mIsUnlocked; }
- set { mIsUnlocked = value; }
- }
-
-
-
- public bool IsRevealed
- {
- get { return mIsRevealed; }
- set { mIsRevealed = value; }
- }
-
-
-
- public string Id
- {
- get { return mId; }
- set { mId = value; }
- }
-
-
-
- public string Description
- {
- get { return this.mDescription; }
- set { mDescription = value; }
- }
-
-
-
- public string Name
- {
- get { return this.mName; }
- set { mName = value; }
- }
-
-
-
-
-
-
-
- public DateTime LastModifiedTime
- {
- get { return UnixEpoch.AddMilliseconds(mLastModifiedTime); }
- set
- {
- TimeSpan ts = value - UnixEpoch;
- mLastModifiedTime = (long) ts.TotalMilliseconds;
- }
- }
-
-
-
- public ulong Points
- {
- get { return mPoints; }
- set { mPoints = value; }
- }
-
-
-
- public string RevealedImageUrl
- {
- get { return mRevealedImageUrl; }
- set { mRevealedImageUrl = value; }
- }
-
-
-
- public string UnlockedImageUrl
- {
- get { return mUnlockedImageUrl; }
- set { mUnlockedImageUrl = value; }
- }
- }
- }
- #endif
|