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 theAssets\Plugins\Windows\res\hive_config.xml file in the editor's project.
- The Hive SDK additional files (resources files such as.dll, .pak,.bin) are copied to the executable file folder generated by Unity Build byAssets\Hive_SDK_v4\Editor\HivePostprocess.cs. If copying is not done, copy it directly as follows:
- Assets\Hive_SDK_v4\Plugins\desktop\hive_string → [Executable file folder]\resources\hive_string
- Assets\Hive_SDK_v4\Plugins\Windows\additional → [Executable file folder] (.meta files excluded)
- Assets\Plugins\Windows\res\hive_config.xml → [Executable file folder]>\resources\hive_config.xml
- The version setting is also carried out through the script Assets\Hive_SDK_v4\Editor\HivePostprocess.cs using the version set in the project. If the version of the resulting executable file has not changed, you can change it directly in CMD or Powershell using Assets\Hive_SDK_v4\Plugins\Windows\postBuildUtil\rcedit.exe.
- Reference
- Example:
rcedit.exe "D:\Hive\_SDK\_UnityPlugin\_Sample\b\Hive\_SDK\_v4\_Unity.exe" --set-product-version 1.0.3 --set-file-version 1.0.3
- Result:
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