Standard Login method

Note: This flow is not zero friction flow.

Step 1 – Adding GG Prefabs into Game Scene

  1. To use the standard login method using gamergraph, do the following:
  2. Go to Assets-> Gamergraph -> Prefabs -> GG_Essentials and drag and drop GG_Core and GG_Login_Signup into your hierarchy.

Figure 1 : Adding GG Prefabs into Game Scene

Step 2 – Setting up a Login Canvas

Next, set up a canvas with 2 input fields for:

1. Email

2. Password


And, add a button to canvas so that when pressed, the user logs in, as shown below

 

Figure 2 : Setting up a login canvas


Step 3 – Assign Login Button to GG Prefab

  1. Next, expand the GG_Login_Signup prefab, and select the first child object.
  2. Assign the login button you created in the script section.

 

Figure 3 : Assign Login button to GG prefab


Step 4 – Assign Input Fields to GG Prefab

Next, select the second child object and assign the 2 input fields in the login section.

Figure 4 : Assign input fields to GG Prefab


That’s it! You have successfully setup the standard login method!


Step 5 – Login callbacks to handle actions

Login Callbacks

*Callbacks, if implemented, are called automatically. All you have to do is put the code inside callbacks.

After logging a user in, you would want to perform some tasks. Those tasks may include, but not limited to:

  1. Changing scenes
  2. Perform other game related tasks.

All this can be accomplished using the login callbacks provided by gamergraph.

To implement login callback:

  1. Create a C# script, and open it in any code editor.
  2. Instead of monobehaviour, extend the script form          GamerGraph_Plugin.GamerGraph_Callbacks.GG_LoginSignupCallbacks
  3. Implement the following callbacks for login as shown below.
  4. Attach this script to any gameobject in your scene!


Figure 5 : Login Callbacks

Callback explanation: (Login)

  1. The first callback is the Pre login callback. Anything you want to do before login event happens, put its code inside this callback.
  2. The second callback is the Post login callback. Put the implementation code of all the instructions that must happen after login inside this callback. 
  3. The third callback is the failed login callback. If a login fails, the code that handles it must be placed inside this callback.


Note: Since zero friction flow does not require any types of credentials, you can still implement these same callbacks for login in a zero-friction flow scenario and handle things as the same.


You might like these

No items found.