Program Development

Log into FactVerse

Logging into FactVerse is the first step to using SDK. Please make sure that you have completed the login part in the subsequent Hands-on labs.
SDK
Beginner

Through this example, you will know:

  • How to initialize the function modules of the SDK.
  • The specific process of logging into the FactVerse cloud service.
  • The common interfaces of AccountManager and how to use them.

Steps

1

Preparation

Install the latest version of FactVerse SDK | DataMesh.

2

Usage example

  1. Go to the "01 Account - Login and logout" directory and open the LoginSample scene.

The relevant code is placed under this path:

  1. Select the LoginSample object and check the information in the Inspector panel.

  1. Open the DCS.json configuration file related to the DCS Profile property and modify server configurations.

Note: Adjust settings based on your actual usage.

  1. Pay attention to the AccountManager object (Prefab) under the DataMeshModule object, which manages the main logic for the user module.

  1. Start the scene. If already logged in, the successful login window will appear. If not, enter the account login window.

  1. In the account login window, enter the account and password, then click the login button. The system will verify the credentials. If the validation fails, it will prompt "incorrect username or password"; if validation succeeds, it will proceed to tenant selection.
  2. If there's only one tenant on the account, it will be chosen by default. If there are multiple tenants, a selection window will open for you to choose from.

  1. After selecting the tenant, the login process will start. Upon success, the login success window will display current account information.

  1. Click the logout button; after confirmation, you will return to the account login window.

  1. Note: If previously logged in but facing token verification issues, manually delete the project's token storage file to initiate a fresh login.
  • The token storage directory is located in [PersistencePath]/LoginData/. You can delete this directory.
  • To find [PersistencePath], refer to the Unity documentation on Application.persistencePath.