Exemple #1
0
        internal static AchievementMetadata Create(IDContainer _container)
        {
            AchievementMetadata _newObject = new AchievementMetadata();

            _newObject.m_globalID    = _container.GlobalID;
            _newObject.m_platformIDs = _container.PlatformIDs;

            return(_newObject);
        }
Exemple #2
0
        /// <summary>
        /// Returns the number of steps required for completing the specified achievement.
        /// </summary>
        /// <returns>The no of steps required to complete specified achievement.</returns>
        /// <param name="_achievementGID">An unified string internally used to identify the achievement across all the supported platforms.</param>
        /// <remarks>
        /// \note Works only if, achievement metadata was configured in NPSettings or else explicitely set using <see cref="SetAchievementMetadataCollection"/>.
        /// </remarks>
        public int GetNoOfStepsForCompletingAchievement(string _achievementGID)
        {
            AchievementMetadata _achievementMetadata = (AchievementMetadata)GameServicesUtils.achievementMetadataCollection.FindObjectWithGlobalID(_achievementGID);

            if (_achievementMetadata == null)
            {
                return(-1);
            }

            return(_achievementMetadata.NoOfSteps);
        }
Exemple #3
0
        public void SetAchievementIDCollection(params IDContainer[] _idCollection)
        {
            int _count = _idCollection.Length;

            AchievementMetadata[] _metadataCollection = new AchievementMetadata[_count];

            for (int _iter = 0; _iter < _count; _iter++)
            {
                _metadataCollection[_iter] = AchievementMetadata.Create(_idCollection[_iter]);
            }

            SetAchievementMetadataCollection(_metadataCollection);
        }
Exemple #4
0
        private void Initialise()
        {
            // Initialise product settings
            m_assetStoreProduct = new AssetStoreProduct(kProductName, kProductVersion, Constants.kLogoPath);

            // Initialise Game Services settings
#if USES_GAME_SERVICES
            if (m_gameServicesSettings.AchievementMetadataCollection == null)
            {
                IDContainer[]         _achievementIDCollection = m_gameServicesSettings.AchievementIDCollection;
                int                   _count = _achievementIDCollection.Length;
                AchievementMetadata[] _metadataCollection = new AchievementMetadata[_count];

                for (int _iter = 0; _iter < _count; _iter++)
                {
                    _metadataCollection[_iter] = AchievementMetadata.Create(_achievementIDCollection[_iter]);
                }

                m_gameServicesSettings.AchievementMetadataCollection = _metadataCollection;
            }

            if (m_gameServicesSettings.LeaderboardMetadataCollection == null)
            {
                IDContainer[]         _leaderboardIDCollection = m_gameServicesSettings.LeaderboardIDCollection;
                int                   _count = _leaderboardIDCollection.Length;
                LeaderboardMetadata[] _metadataCollection = new LeaderboardMetadata[_count];

                for (int _iter = 0; _iter < _count; _iter++)
                {
                    _metadataCollection[_iter] = LeaderboardMetadata.Create(_leaderboardIDCollection[_iter]);
                }

                m_gameServicesSettings.LeaderboardMetadataCollection = _metadataCollection;
            }
#endif
        }