The HMS Game development with Unity
Account kit which is powered by HMS allows us to perform login and logout with highly secure information of user. Account Kit provides simple, secure, and quick sign-in and authorization functions. Instead of entering accounts and passwords and waiting for authentication.
Overview
In this article, I will setup Unity Engine and create a demo game and integrate HMS Account Kit. So user can easily perform login and logout. I will cover every aspects of the game development with HMS based account functionality.
Service Introduction
Account kit which is powered by HMS allows us to perform login and logout with highly secure information of user. Account Kit provides simple, secure, and quick sign-in and authorization functions. Instead of entering accounts and passwords and waiting for authentication.
Prerequisite
1. Unity Engine (Installed in system)
2. Huawei phone
3. Visual Studio 2019
4. Android SDK & NDK (Build and Run)
Integration process
1. Sign In and Create or Choose a project on AppGallery Connect portal.
2. Navigate to Project settings and download the configuration file.
Game Development
1. Create new game in Unity.
2. Click 3D, enter Project Name, and then click to CREATE.
3. Now add game components and let us start game development.
4. Download HMS Unity Plugin from below site.
https://github.com/EvilMindDevs/hms-unity-plugin/releases
5. Open Unity Engine and import downloaded HMS Plugin.
Choose Assets > Import Package> Custom Package
6. Choose Huawei > App Gallery.
7. Provide the AppId and other details from agconnect-service.json file and click configure Manifest.
8. Create HMS Account based scripts.
I have created PlayerController.cs file in which integrated Account Kit login functionality.
Clickon PlayerController.cs and open in Visual Studio 2019
Result
Let us build the apk and install in android device.
Tips & Tricks
1. Download latest HMS plugin.
2. HMS plugin v1.2.0 supports 7 kits.
3. HMS Unity Plugin v1.1.2 supports 5 kits.
Conclusion
In this Article, We have learned how to integrate Account Kit in Unity based Game.
User can login without entering email id or password with secure and simple.
Thanks for reading this article. Be sure to like and comments to this article if you found it helpful. It means a lot to me.
References