Get started
This section explains how to start using Unity Cloud Python SDK.
阅读时间1 分钟最后更新于 10 个月前
Before you begin, verify you meet the prerequisites.
Install the Python SDK package
To install Python SDK, follow these steps:- Run the following command:
pip install --index-url https://unity3ddist.jfrog.io/artifactory/api/pypi/am-pypi-prod-local/simple unity-cloud - If it's not the first time you're installing the Python SDK, add the argument in the command as follows:
--force-reinstall.pip install --index-url https://unity3ddist.jfrog.io/artifactory/api/pypi/am-pypi-prod-local/simple unity-cloud --force-reinstall
Use the Python SDK
To use the SDK, first callinitialize()def initialize():unity_cloud.initialize()unity_cloud.identity.user_login.use()# Check whether the user is signed inauth_state = unity_cloud.identity.user_login.get_authentication_state()if auth_state != unity_cloud.identity.user_login.Authentication_State.LOGGED_IN: unity_cloud.identity.user_login.login()
However, if you need to run an initialization again, you must uninitialize before that. Here is an example of the typical uninitialize process:
Read more about the Identity module and managing authentication.def uninitialize():unity_cloud.uninitialize()