Skip to main content

Debug SDK Functions

This page will show you a sample scene named Debug SDK Functions. It will break down most of the API functions inside the Genies Avatar SDK.

info

This page will be using version X.Y.Z of the Genies SDK Avatar package, but replace it with the latest package version.

Import the Sample Scene

From the top menu, select Windows > Package Manager window. Then select Packages: In Project on the top left dropdown and also select the Genies Avatar SDK package on the left side menu.

Click the Samples tab and click the Import button next to the Debug SDK Functions sample.

Download Sample

Open the Example Scene

In your Project window, open the Assets > Samples > Genies Avatar SDK > X.Y.Z > Debug SDK Functions > Scenes folder. Double click the SdkFunctionsDebug scene to open it.

Sample Scene

Test the Example Scene

The next steps will show to test the sample scene functionality.

Start the OTP Login

The first step will be to login to your Genies account. Press the Play button.

In the Hierarchy window, select the Editor_RuntimeSdkFunctions object. Then in the Inspector window, click the (Re)Start Email OTP Login button.

Play Scene

Submit Email

A new component should appear. Enter your email in the input field. Then press the Submit Email button.

Submit Phone

Submit the OTP Code

The component should update and you should receive an email. Add the OTP code into the input field and click the Submit Email Code button.

Submit OTP

tip

Click the Resend Email Code button if you did not receive an email.

Confirm the Login

A new component should appear and display your Genies login name if the login was succesful.

Confirm Login

Spawn the User Avatar

Click the Spawn User Avatar button one time.

Spawn User

note

Clicking the Spawn User Avatar button multiple times in quick succession may cause Unity to crash.

Confirm the User Avatar Spawned

You should now see the user Avatar spawn in the Scene window.

User Avatar

Open the Avatar Editor

Click the Open Avatar Editor button.

Open Editor

Test the Avatar Editor

The Avatar Editor should appear . Try changing your Avatar's looks.

Avatar Editor

Close the Avatar Editor

Click the Close Avatar Editor button.

Close Editor

Spawn the Default Avatar

Click the Spawn Default Avatar button.

Spawn Default

Confirm the Default Avatar Spawned

You should now see the default Avatar spawn in the Scene window. You may have to move one of the Avatar objects to see both of them.

Default Avatar

note

Your user Avatar may look identical to the default Avatar if you have never edited your Avatar before.

Destroy All the Avatars

Click the Destroy All Spawned Avatars button. The Avatars should be deleted from the scene.

Destroy Avatars

Test the Instant Login

Exit Play mode. Activate the Instant Login On Start button. Press the Play button. It should login instantly using your cached credentials.

Instant Login

Conclusion

All of the logic for this sample scene can be found in the Assets > Samples > Genies Avatar SDK > X.Y.Z > Debug SDK Functions > Scripts folder. It's recommended to look through these scripts to understand how it works.

Sample Scripts