Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Social

class in UnityEngine

/

Implemented in:UnityEngine.GameCenterModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Generic access to the Social API.

Social.Active can be used to target a specific social platform implementation, but by default GameCenter is used on iOS. All other platforms default to the Local implementation which can be used for testing. See Social API Reference Manual for an overview.

The Social class should always be used as an entry point. It contains helper functions for accessing the current active implementation and always uses the interfaces of the other Social API classes. This way it is easier to use versions of the interfaces which have been extended beyond the generic API by the implementation.

There are various classes accociated with the Social API and all of these reside in the UnityEngine.SocialPlatforms namespace. You need to import/use this namespace in order to use these classes.


See Also: GameCenterPlatform.

Static Properties

ActiveThis is the currently active social platform.
localUserThe local user (potentially not logged in).

Static Methods

CreateAchievementCreate an IAchievement instance.
CreateLeaderboardCreate an ILeaderboard instance.
LoadAchievementDescriptionsLoads the achievement descriptions accociated with this application.
LoadAchievementsLoad the achievements the logged in user has already achieved or reported progress on.
LoadScoresLoad a default set of scores from the given leaderboard.
LoadUsersLoad the user profiles accociated with the given array of user IDs.
ReportProgressReports the progress of an achievement.
ReportScoreReport a score to a specific leaderboard.
ShowAchievementsUIShow a default/system view of the games achievements.
ShowLeaderboardUIShow a default/system view of the games leaderboards.
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答