Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by siddharth3322 · Aug 27, 2014 at 02:40 AM · multiplayergoogle

Display player image and name using google

I am working on multiplayer game and I want to attach player name and photograph that it attach with it google account. I have implemented Google Play Games for my game.

So I have doing login with Google but can't know how to use account detail such as name and photograph? I know more information related to this. Please give some suggestion in this.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
11

Answer by praveee · Aug 27, 2014 at 03:30 AM

If you using Google Play Games plugin for Unity plugin it allows you to access the Google Play Games API through Unity's social interface.

 void Awake()
     {
        Social.localUser.Authenticate (ProcessAuthentication);
     }
     
    private void ProcessAuthentication (bool success) 
    {
         if (success) 
         {
             UserName  = Social.localUser.userName; // UserName
             UserID      = Social.localUser.id; // UserID
             ProfilePic    =Social.localUser.image; // ProfilePic
         }
         else
         {
             Debug.LogWarning ("Failed to authenticate");
         }
     }

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image siddharth3322 · Aug 27, 2014 at 03:32 AM 0
Share

Thanks @praveee, I will check this and reply you shortly. Also if you have information regarding player data management then please give it also.

I have use google for accessing player data for multiplayer game or move towards facebook integration.

What is your suggestion?

avatar image praveee · Aug 27, 2014 at 05:59 AM 0
Share

What do you mean by player data management? using google or facebook as social platform will depending on your target audience.

avatar image yeagz7 · Sep 12, 2014 at 05:31 AM 0
Share

The Social.localUser.image is always going to be null. You have to use the URI for the profile picture with the Image$$anonymous$$anager. Or that's what has been said here. I just can't figure out how to do it haha.

avatar image
1

Answer by Adishah11 · Jun 06, 2018 at 08:24 AM

Also assign some texture to "tex" (tex is Texture2D)

void RealTimeMultiplayerListener.OnRoomConnected (bool success) { debug.text = "Connected"; Participant p = PlayGamesPlatform.Instance.RealTime.GetSelf ();

         MineId.text = p.ParticipantId;
         MineName.text = p.DisplayName;
         StartCoroutine (image(p.Player.AvatarURL));
 }
 
         IEnumerator image(string url){
             using (WWW www = new WWW (url)) {
                 yield return www;
                 www.LoadImageIntoTexture (tex);
                 ImgMine.sprite = Sprite.Create (tex, new Rect (0.0f, 0.0f, tex.width, tex.height), new Vector2 (0f, 0f));
             }
         }
 
 
 
 
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Unity photon network - game room 1 Answer

Google Sketchup model problem in Unity 1 Answer

Unity Network Instantiate Issue 0 Answers

Where to get official support for the Google Play OBB Downloader plugin? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges