Stay organized with collections
Save and categorize content based on your preferences.
GooglePlayGames.PlayGamesUserProfile
Represents a Google Play Games user profile.
Summary
Implements the Unity's IUserProfile
interface and is used as a base class for PlayGamesLocalUser.
Inheritance
Inherits from: IUserProfile
Direct Known Subclasses:
GooglePlayGames.BasicApi.Player,
GooglePlayGames.BasicApi.PlayerProfile,
GooglePlayGames.PlayGamesLocalUser
Properties
|
AvatarURL
|
string
Gets the URL of the user's avatar.
|
gameId
|
string
Gets the user's game-specific identifier.
|
id
|
string
Gets the user's unique player ID.
|
image
|
Texture2D
Gets the user's avatar image as a Texture2D.
|
isFriend
|
bool
Gets a value indicating whether this user is a friend of the local user.
|
state
|
UserState
Gets the user's current state.
|
userName
|
string
Gets the user's display name.
|
Protected functions
|
ResetIdentity(string displayName, string playerId, string avatarUrl)
|
void
Resets the user's identity with new information.
|
Properties
AvatarURL
string AvatarURL
Gets the URL of the user's avatar.
gameId
string gameId
Gets the user's game-specific identifier.
In this implementation, it is the same as the player ID.
id
string id
Gets the user's unique player ID.
The player ID.
image
Texture2D image
Gets the user's avatar image as a Texture2D.
The image is loaded asynchronously. Returns null until the image has been loaded.
The user's avatar image.
isFriend
bool isFriend
Gets a value indicating whether this user is a friend of the local user.
true
if this user is a friend; otherwise, false
.
state
UserState state
Gets the user's current state.
In this implementation, it always returns 'Online'.
userName
string userName
Gets the user's display name.
The name of the user.
Protected functions
ResetIdentity
void ResetIdentity(
string displayName,
string playerId,
string avatarUrl
)
Resets the user's identity with new information.
If the avatar URL has changed, the old image is discarded.
Details |
Parameters |
displayName
|
The new display name.
|
playerId
|
The new player ID.
|
avatarUrl
|
The new avatar URL.
|
|
Public functions
Equals
override bool Equals(
object obj
)
Determines whether the specified System.Object is equal to the current PlayGamesUserProfile.
Equality is based on the player ID.
Details |
Parameters |
|
Returns
|
true if the specified object is equal to the current object; otherwise, false .
|
GetHashCode
override int GetHashCode()
Serves as a hash function for a PlayGamesUserProfile object.
Details |
Returns
|
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
|
ToString
override string ToString()
Returns a System.String that represents the current PlayGamesUserProfile.
Details |
Returns
|
A string representation of the object.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-07-08 UTC.
[null,null,["Last updated 2025-07-08 UTC."],[],[],null,["# GooglePlayGames.PlayGamesUserProfile Class Reference\n\nGooglePlayGames.PlayGamesUserProfile\n====================================\n\nRepresents a Google Play Games user profile.\n\nSummary\n-------\n\nImplements the Unity's `IUserProfile` interface and is used as a base class for [PlayGamesLocalUser](/games/services/unity/v2/api/class/google-play-games/play-games-local-user#class_google_play_games_1_1_play_games_local_user).\n\n### Inheritance\n\nInherits from: IUserProfile \nDirect Known Subclasses:[GooglePlayGames.BasicApi.Player](/games/services/unity/v2/api/class/google-play-games/basic-api/player), [GooglePlayGames.BasicApi.PlayerProfile](/games/services/unity/v2/api/class/google-play-games/basic-api/player-profile), [GooglePlayGames.PlayGamesLocalUser](/games/services/unity/v2/api/class/google-play-games/play-games-local-user)\n\n| ### Properties ||\n|------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [AvatarURL](#class_google_play_games_1_1_play_games_user_profile_1a71d39715173c138166e268a494ec52f2) | `string` Gets the URL of the user's avatar. |\n| [gameId](#class_google_play_games_1_1_play_games_user_profile_1a0996268384dbaea0b6c00d21acec5bf1) | `string` Gets the user's game-specific identifier. |\n| [id](#class_google_play_games_1_1_play_games_user_profile_1ab820dee129b6a7fe2fc576030a711f18) | `string` Gets the user's unique player ID. |\n| [image](#class_google_play_games_1_1_play_games_user_profile_1aad98593bbb94b66094fd42039b57f8b4) | `Texture2D` Gets the user's avatar image as a Texture2D. |\n| [isFriend](#class_google_play_games_1_1_play_games_user_profile_1ade393e3e3c3f7c3ece086c1bcc7efd1d) | `bool` Gets a value indicating whether this user is a friend of the local user. |\n| [state](#class_google_play_games_1_1_play_games_user_profile_1a5e31dd6d1d8e7b62c469d7ffcfbe5503) | `UserState` Gets the user's current state. |\n| [userName](#class_google_play_games_1_1_play_games_user_profile_1af55c5392ac08e0387b47927fc4e9b1c3) | `string` Gets the user's display name. |\n\n| ### Protected functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|\n| [ResetIdentity](#class_google_play_games_1_1_play_games_user_profile_1a78ab519b9474193dc0989dd16f931693)`(string displayName, string playerId, string avatarUrl)` | `void` Resets the user's identity with new information. |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Equals](#class_google_play_games_1_1_play_games_user_profile_1acfe2689b25bcbd7bf0a5d6fde380de3f)`(object obj)` | `override bool` Determines whether the specified System.Object is equal to the current [PlayGamesUserProfile](/games/services/unity/v2/api/class/google-play-games/play-games-user-profile#class_google_play_games_1_1_play_games_user_profile). |\n| [GetHashCode](#class_google_play_games_1_1_play_games_user_profile_1a30acefa44308b433ee352ba16e4029dd)`()` | `override int` Serves as a hash function for a [PlayGamesUserProfile](/games/services/unity/v2/api/class/google-play-games/play-games-user-profile#class_google_play_games_1_1_play_games_user_profile) object. |\n| [ToString](#class_google_play_games_1_1_play_games_user_profile_1adf64a14193feef41a37d554d2599a03a)`()` | `override string` Returns a System.String that represents the current [PlayGamesUserProfile](/games/services/unity/v2/api/class/google-play-games/play-games-user-profile#class_google_play_games_1_1_play_games_user_profile). |\n\nProperties\n----------\n\n### AvatarURL\n\n```c#\nstring AvatarURL\n``` \nGets the URL of the user's avatar. \n\n### gameId\n\n```c#\nstring gameId\n``` \nGets the user's game-specific identifier.\n\nIn this implementation, it is the same as the player ID. \n\n### id\n\n```c#\nstring id\n``` \nGets the user's unique player ID.\n\nThe player ID. \n\n### image\n\n```c#\nTexture2D image\n``` \nGets the user's avatar image as a Texture2D.\n\nThe image is loaded asynchronously. Returns null until the image has been loaded.\n\nThe user's avatar image. \n\n### isFriend\n\n```c#\nbool isFriend\n``` \nGets a value indicating whether this user is a friend of the local user.\n\n`true` if this user is a friend; otherwise, `false`. \n\n### state\n\n```c#\nUserState state\n``` \nGets the user's current state.\n\nIn this implementation, it always returns 'Online'. \n\n### userName\n\n```c#\nstring userName\n``` \nGets the user's display name.\n\nThe name of the user.\n\nProtected functions\n-------------------\n\n### ResetIdentity\n\n```c#\nvoid ResetIdentity(\n string displayName,\n string playerId,\n string avatarUrl\n)\n``` \nResets the user's identity with new information.\n\nIf the avatar URL has changed, the old image is discarded.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |---------------|-----------------------| | `displayName` | The new display name. | | `playerId` | The new player ID. | | `avatarUrl` | The new avatar URL. | |\n\nPublic functions\n----------------\n\n### Equals\n\n```c#\noverride bool Equals(\n object obj\n)\n``` \nDetermines whether the specified System.Object is equal to the current [PlayGamesUserProfile](/games/services/unity/v2/api/class/google-play-games/play-games-user-profile#class_google_play_games_1_1_play_games_user_profile).\n\nEquality is based on the player ID.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `obj` | The System.Object to compare with the current [PlayGamesUserProfile](/games/services/unity/v2/api/class/google-play-games/play-games-user-profile#class_google_play_games_1_1_play_games_user_profile). | |\n| **Returns** | `true` if the specified object is equal to the current object; otherwise, `false`. |\n\n### GetHashCode\n\n```c#\noverride int GetHashCode()\n``` \nServes as a hash function for a [PlayGamesUserProfile](/games/services/unity/v2/api/class/google-play-games/play-games-user-profile#class_google_play_games_1_1_play_games_user_profile) object.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|------------------------------------------------------------------------------------------------------------------------|\n| **Returns** | A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table. |\n\n### ToString\n\n```c#\noverride string ToString()\n``` \nReturns a System.String that represents the current [PlayGamesUserProfile](/games/services/unity/v2/api/class/google-play-games/play-games-user-profile#class_google_play_games_1_1_play_games_user_profile).\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|----------------------------------------|\n| **Returns** | A string representation of the object. |"]]