# 安装

> Install the Economy SDK in your Unity project and configure authentication.

## 开始使用##getting-started

开始使用 Economy SDK：

1. 使用 Unity 中的 Services（服务）窗口登录到您的云项目。
2. 使用 [Package Manager（包管理器）](https://docs.unity3d.com/Manual/upm-ui.html)安装所需的包版本。
3. 使用 `await UnityServices.InitializeAsync()` 初始化 Core SDK。
4. 登录 Authentication SDK，如下所述。

> **Note:**
>
> 因为访问 Economy 服务需要有效的玩家 ID 和访问令牌，Economy SDK 要求在使用任何 Economy API 之前完成来自 Authentication SDK 的身份验证流程。请参阅 [Unity Authentication](/authentication.md)。

## 使用 SDK##using-the-sdk

使用 [Authentication](../implementation#authentication) SDK 登录完成后，Economy SDK 即可立即使用。然后，您可以调用本指南中的任何方法来开始与 Economy 数据交互。

## Economy 后台##economy-in-the-unity-dashboard

只有当您通过 [Unity Dashboard（Unity 后台）](https://dashboard.unity3d.com/)中的 Economy 后台发布首个 Economy 配置后，SDK 功能才能使用。

开始使用：

1. 登录 Unity Dashboard（Unity 后台）。
2. 使用侧面菜单导航到 Economy 部分。
3. 在配置中添加一些资源。
4. 当您准备好在 SDK 中使用配置时，单击 **Publish（发布）**。

## 环境##environments

环境是指 Unity Game Services（Unity 游戏服务）的逻辑分区，其中包含与项目关联的数据。

您可以在 Economy 后台和初始化脚本中设置目标环境。请参阅 [Unity 环境](/services/service-environments.md)。

## IL2CPP 构建##il2cpp-builds

Economy 目前不支持在使用 IL2CPP 作为脚本后端进行构建时，使用 Unity 编辑器的 **Faster (smaller) builds** 选项。相反，请在编辑器中选择 **Build Settings（构建设置）**> **IL2CPP Code Generation（IL2CPP 代码生成）**> **Faster runtime（更快运行时）**。
