Chapter 58 Unity releases PC platform

In this chapter, we introduce how to package games to the PC platform. Here we focus on how to make game packages under the Windows operating system. First, we create a "PcDemo" project, and then simply arrange the scene content, as follows

To package and publish the Unity project, we can select the "File" → "Build Settings" menu command in the menu bar.

The "Platforms" on which we can publish are evident in the Platform list, the first option "PC, Mac & Linux Standalone" is used to build standalone applications for most desktop platforms. Next, let's look at the settings on the right.

Target Platform target platform, you can choose Windows, macOS X or Linux. Of course, whether we can choose one of them depends on whether we have installed the compiled library of the target platform when we installed Unity.

Architecture can choose x86 or x86_64. At present, most of our PCs are 64-bit machines, so choose x86_64.

Server Build Checking this option means that our project is a server program. It is not checked by default.

Copy PDB files Check this option to include Microsoft Program Database (.pdb) files. It is not checked by default.

Create Visual Studio Solution Enable this setting to generate a Visual Studio solution file for the project so that the final executable can be built in Visual Studio. It is not checked by default.

Development Build Enable this setting to include script debugging symbols and the Profiler in the build. It is not checked by default.

You also noticed the "Scens In Build" panel, which is actually a list of scenes. We need to add the "Add Open Scenes" button in the lower left corner to add the scene we created (for example, the default scene SampleScene.unity).

 

Unity uses the scene list to determine the order in which to load scenes. To adjust the order of the scenes, drag the scenes up or down in the list. If there are multiple scenes, we also need to add them all.

There is also a "Player Settings" button in the lower left corner of the "Build Settings" window

Here you can further set some details of our package release

Company NameCompany name

Product Name Project name, or called the game name.

Version is the version of the project. The default version is 0.1.

Default Icon is the project startup icon.

Default Cursor is the style of the mouse and an icon.

Cursor Hotspot is to set the pixel offset value from the upper left corner of the Default Cursor to the "mouse hotspot position". We know that the style of the mouse is a very small picture, not a point. But when we use the mouse, the obtained mouse position is a point (X/Y coordinate value). No matter how small a picture is, it is impossible to be a point, so we need to define a point in the picture as the real position of the mouse. This offset is what is used to set this. Because we use a very small picture as the mouse style, we can use the default values ​​(X=0, Y=0) for fuzzy matching. If we need to specify this position precisely, we need to set the offset accordingly according to the content of our picture.

Here, we will not go into detailed settings, we only need to set the company name, game name and startup icon.

For the "Default Icon" icon, we need to place the icon in the Assets directory before we can choose to use it.

Next, I will set up a more detailed grouping of different platforms.

Because what we want to release is the "PC" platform, so choose the first "Settings for PC,Mac&Linux Standalone", under which there are mainly "Icon", "Resolution and Presentation", "Splash Image", "Other Settings" Set of four groups. Next, let's give a general introduction and will not introduce it in detail.

Icon: The game icon displayed on the desktop.

Resolution and Presentation: Settings related to screen resolution.

Splash Image: The image displayed when the game starts. We can set our own Logo. But for the Unity personal version, this function is not allowed to be customized, and the default is Unity's own Logo display.

Other Settings: Any other settings specific to the platform.

Here we simply set the screen resolution, as shown below

The default is that the game runs in full screen, we will change it to window mode, and set the size at the same time

After setting, we directly close the "Player Settings" window and return to the previous "Build Settings" window. We click the "Build" button in the lower right corner, and then select a save directory location (E:\workspace\target) in the pop-up dialog box.

 

Unity started packaging and publishing. Let's go to the "E:\workspace\target" directory location to check.

We click on "PcDemo.exe" to start the file

First, the logo of Unity will be obvious, and then our scene will be displayed

Of course, we can also send the entire folder "E:\workspace\target" packaged and released to other computers to run. In fact, there is another way to publish to the Windows computer platform. In the platform selection list in our "Build Settings" window, there is a "Universal Windows Platform", or UWP for short. The translation is Universal Windows Platform, which is a general platform developed by Microsoft based on Win10. Applications published in this way can run on all of Microsoft's own devices (such as Microsoft's Xbox). We will not introduce this UWP method in detail, and interested students can study it by themselves.

The content involved in this course has been shared to Baidu Netdisk: https://pan.baidu.com/s/1e1jClK3MnN66GlxBmqoJWA?pwd=b2id

Guess you like

Origin blog.csdn.net/konkon2012/article/details/130654818