The
C++ Class Wizard
provides a fast and easy way to add native C++ code classes into your project for you to extend
with your own functionality, if you wish. This converts a content-only project into a code project. You can access the C++ Class Wizard like so:
Please make sure you are running Visual Studio 2015 or higher for Windows Desktop installed before proceeding. If you are using Mac, make sure to have Xcode 8 or higher installed.
In the main editor, select
File > New C++ Class...
The
C++ Class Wizard
will appear, showing commonly added classes. If you do not see the class you are looking for, then you will need to view the entire Class hierarchy listing. Click the
Show All Classes
checkbox in the upper-right corner of the window.
Default Classes
All Classes
Choose the Class you wish to add and click the
Next >
button.
You will then be prompted to enter a
Name
for your new Class. Do so and click the
Create Class
button. This will create the header (.h) and source (.cpp) files.
Class names may only contain alphanumeric characters and cannot contain spaces. The field will notify you if you enter an invalid name.
The code will immediately open in Visual Studio, ready for editing.
The code will immediately open in Xcode, ready for editing.
Code files can be created through Visual Studio and added to the game project through the
Solution Explorer
in the usual manner. You can also add code files to the appropriate folders outside of Visual Studio and rebuild
the solution and project files automatically. This makes it easy to add lots of files quickly through the operating system UI, and also makes working on teams
easier as the solution and project files do not need to be synced between members of the team. Each person can
just sync the code files and rebuild the project files locally.
Code files can be created through Xcode and added to the game project through the
Project Navigator
in the usual manner.
You can also add code files to the appropriate folders outside of Xcode and rebuild the project file automatically.
This makes it easy to add lots of files quickly through the operating system UI, and also makes working on teams easier
as the solution and project files do not need to be synced between members of the team. Each person can just sync the
code files and rebuild the project files locally.
Opening Projects in the Development Environment
If your project is already open in the editor, you can easily open it in Visual Studio by selecting
Open Visual Studio
from the
File
menu.
You can also open the project in Visual Studio through Windows Explorer or Visual Studio's
File > Open > Project/Solution
.
Open the [ProjectName].sln Visual Studio solution located in the root of the project's directory.
If your project is already open in the editor, you can easily open it in Xcode by selecting
Open in Xcode
from the
File
menu.
You can also open the project in Xcode through Finder or Xcode's
File > Open
.
Open the [ProjectName].xcodeproj Xcode project located in the root of the project's directory.
Generating Project Files
The project files are considered intermediate files - located in
[ProjectDirectory]\Intermediate\ProjectFiles
. This means if you delete your
Intermediate
folder, you must regenerate the project files.
.uproject files
Navigate to the location of [ProjectName].uproject in Windows Explorer.
Right-click
on the [ProjectName].uproject file and select
Generate Visual Studio Files
.
UnrealBuildTool updates the project files and the solution, including generating Intellisense data.
Open the [ProjectName].sln Visual Studio solution located in the root of the project's directory to view the game project in Visual Studio.
Navigate to the location of [ProjectName].uproject in Finder.
Right-click
on the [ProjectName].uproject file and select Generate Xcode Files.
UnrealBuildTool updates the project
Open the [ProjectName].xcodeproj Xcode project located in the root of the project's directory to view the game project in Xcode.