Unity Windows
Hive SDK Unity Windows app development requires the following settings when building the app after development.
Build pre-configuration¶
Before building the Windows project, configure the following settings in the editor's File > Build Settings...:
- Set up the build:
- Configure the player: You can set it up by pressing the Player Settings... button at the bottom left of the Build Settings... window or in the Player category of the Inspector window.
- Configure theHIVE_PLUGIN.dll file: Refer to the image below and set theHIVE_PLUGIN.dll file in theAssets\Hive_SDK_v4\Plugins\Windows folder in the Inspector window.
Build configuration¶
Depending on whether Generate Visual Studio Solution is selected during build configuration, proceed with either Option 1. or Option 2. below.
Option 1. Visual Studio solution generation: False¶
- Prepare the Assets\Plugins\Windows\res\hive_config.xml file in the editor's project.
- The Hive SDK additional files (resource files such as .dll, .pak, .bin) will be copied by Assets\Hive_SDK_v4\Editor\HivePostprocess.cs into the folder where the executable generated by Unity Build is located. If they are not copied, please copy them manually as follows:
- Assets\Hive_SDK_v4\Plugins\desktop\hive_string → [Executable Folder]\resources\hive_string
- Assets\Hive_SDK_v4\Plugins\Windows\additional → [Executable Folder] (excluding .meta files)
- Assets\Plugins\Windows\res\hive_config.xml → [Executable Folder]\resources\hive_config.xml
- If you copied the files manually in the previous step, move the contents under the [Executable Folder]\hive-sdk-res folder to the [Executable Folder]\resources folder.
- If you have moved all the contents from [Executable Folder]\hive-sdk-res, you can delete the hive-sdk-res folder.
- The Assets\Hive\SDK\v4\Editor\HivePostprocess.cs script sets the version using the version specified in the project. If the executable version has not changed, you can execute Assets\Hive\SDK\v4\Plugins\Windows\postBuildUtil\rcedit.exe from CMD or PowerShell to change it manually.
Option 2. Visual Studio solution generation: True¶
Perform a Windows target Unity build in the desired folder with the environment configured in Build Pre-Configuration.
Build post-configuration¶
This section describes the necessary settings after building the Hive SDK Unity Windows app. After the Unity build is complete, the following files will be generated.
- build
- Il2CppOutputProject
- [Project name] folder
- UnityPlayerStub
- [Project name].sln
- UnityCommon.props
- locales
- resources
- swiftshader
- .dll
- cef.subprocess.exe
- .pak
- .bin
- icudtl.dat
Version setting¶
You can set the version by modifying FILEVERSION
and PRODUCTVERSION
in theWindowsPlayerVersion.rc file within the[Project name] folder. The modified version is used as appversion
information when communicating with the Hive server.
Visual Studio build and Hive SDK copy¶
- Opensln with Visual Studio, and the executable file will be created in thebuild\bin\x64\Debug (or Master) folder during the build.
- When running the results of Unity 2018.4.17 with Visual Studio 2019, the Retarget Solution process is required.
- Copy files from the folder created during the Unity build to the same folder as the executable file, excluding[Project name_Data].sln andUnityCommon.props.
- Copy thelocales, resources, and swiftshader folders in the same way.
- Modify the contents ofhive_config.xml to match the project, and specify the location in the resources folder under the executable file. (Appid, Google related, Facebook related)
- If the game requires the market value entered in hive_config.xml, enter
HS
, which is the market code for the Hive Store. (However, the market value entered inhive_config.xml does not affect actual service.) -
Copy thebuild\bin\Project name_Data folder to the folder where the executable file is located.
-
The files (*.dll) inbuild\bin[Project name_Data]\plugins are duplicated, so they can be deleted.
- Placing additional.dll and resources inbuild\bin[Project name_Data]\plugins instead of the folder where the executable file is located is partially possible, but there are functions that do not work, so it is copied to the folder where the executable file is located and used.
Note
Redistributable packages are required in environments other than the developer's PC.
When building in debug mode, the debug version DLLs of the redistributable package are required:vccorlib140d.dll, vcruntime140d.dll, cruntime140_1d.dll, ucrtbased.dll, msvcp140d.dll, concrt140d.dl
Deleting unused XML files¶
If you installed or updated the Hive SDK Unity via the Unity package instead of the Hive SDK Manager, you must delete all HIVESDK_{library_name}Dependencies.xml files located in the paths below before building the app.
- Assets/Hive_SDK_v4/Dependencies
- Assets/Hive_SDK_v4/Editor
The examples of files to be deleted are as follows:
- HIVESDK_DefaultDependencies.xml
- HIVESDK_HerculesDependencies.xml
- HIVESDK_HiveAnalyticsConsentModeDependencies.xml
- HIVESDK_HiveDataStoreDependencies.xml
- HIVESDK_HiveDeviceManagementDependencies.xml
- HIVESDK_HiveGoogleInAppReviewDependencies.xml
- HIVESDK_HiveGoogleInAppUpdateDependencies.xml
- HIVESDK_HivePromotionDependencies.xml
- HIVESDK_HiveRealNameVerificationDependencies.xml
- HIVESDK_MarketAmazonDependencies.xml
- HIVESDK_MarketAppleDependencies.xml
- HIVESDK_MarketGoogleDependencies.xml
- HIVESDK_MarketHiveStoreDependencies.xml
- HIVESDK_MarketHuaweiDependencies.xml
- HIVESDK_MarketLebiDependencies.xml
- HIVESDK_MarketOneStoreDependencies.xml
- HIVESDK_MarketSamsungDependencies.xml
- HIVESDK_ProviderAdjustDependencies.xml
- HIVESDK_ProviderAppleDependencies.xml
- HIVESDK_ProviderAppleSignInDependencies.xml
- HIVESDK_ProviderAppsFlyerDependencies.xml
- HIVESDK_ProviderFacebookDependencies.xml
- HIVESDK_ProviderFirebaseDependencies.xml
- HIVESDK_ProviderGoogleDependencies.xml
- HIVESDK_ProviderGooglePlayGamesDependencies.xml
- HIVESDK_ProviderHiveMembershipDependencies.xml
- HIVESDK_ProviderHuaweiDependencies.xml
- HIVESDK_ProviderLineDependencies.xml
- HIVESDK_ProviderQQDependencies.xml
- HIVESDK_ProviderRecaptchaDependencies.xml
- HIVESDK_ProviderSingularDependencies.xml
- HIVESDK_ProviderVKDependencies.xml
- HIVESDK_ProviderWechatDependencies.xml
- HIVESDK_ProviderWeverseDependencies.xml
- HIVESDK_PushAmazonAdmDependencies.xml
- HIVESDK_PushGoogleFcmDependencies.xml