Files
UnrealEngineUWP/Engine/Documentation/Source/Programming/Slate/Setup/SlateProjectSetup.CHN.udn
Ben Marsh 49831a5631 Include documentation source in repository.
[CL 2489162 by Ben Marsh in Main branch]
2015-03-24 08:35:52 -04:00

55 lines
2.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Availability:Public
Title: 在项目中使用Slate
Crumbs:%ROOT%, Programming, Programming/Slate
Description:设置您的项目来使用Slate用户界面架构
## 概述
[EXCERPT:main]
为了使用Slate用户界面架构您的项目必须进行适当的设置以便它可以意识到该
架构。这允许您包含 `Slate.h` 头文件及引用使用Slate构建用户界面
所需的各种架构元素。
## 模块依赖
Slate架构存储在几个模块中。为了使您的项目意识到这些模块的存在
则必须在 *.build.cs 文件中为您的项目设置一些依赖项。
您的项目需要访问的模块是:
| 模块| 依赖类型 |
| --------- | --------------- |
| InputCore | 公有|
| Slate | 私有|
| SlateCore | 私有|
**要想设置Slate模块的依赖项:**
1. 打开您的项目的 `[ProjectName].build.cs` 文件。它位于 `[ProjectDir]/[ProjectName]/Source/[ProjectName]` 目录中。
1. 通过将 `"InputCore"` 添加到 `PublicDependencyModuleNames` 中来添加InputCore公有依赖。
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
[REGION:note]
当创建代码项目时InputCore默认设置为公有依赖。
[/REGION]
1. 添加Slate和SlateCore私有依赖。*.build.cs文件中有一行代码用于添加私有依赖
PrivateDependencyModuleNames.AddRange(new string[] { });
您所需要做的就是将SlateCore和Slate模块添加到那行代码中
PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
[REGION:tip]
根据您创建项目的时机及其引擎版本的不同,它可能已经在
*.build.cs文件中设置了依赖项但是注释掉了。您可以简单地取消注释适当的代码行来
设置依赖!
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
[/REGION]
[/EXCERPT:main]