지원 프로그램
home
슬기로운 데모생활
home

Configure Project Environment

생성일
2024/03/14 04:18
태그

1. Configure Unreal Plugin Folder

Unzip the STOVE PC SDK StovePCSDK_UNREAL_x.x.x.zip file in the StovePCSDK_UNREAL folder, the HelloStove project. Copy the Plugins folder that you see to the HelloStove project and configure it in a state where you can build HelloStove_Unreal as shown in the picture below.
If you double-click HelloStove.uproject, a window appears to select whether to rebuild UNREAL. (Depending on the UNREAL version, the engine version selection window may appear first) If you choose Yes (Y), it creates ancillary folders such as Binaries, Intermediate, and Saved in the corresponding folder. After creating an additional folder, it automatically executes the UNREAL editor.

2. Create VisualStudio Solution

If you complete the Unreal build successfully, create HelloStove.sln using Unreal Engine. You can right-click on the HelloStove.uproject and create a Visual Studio solution.
HelloStove.sln
Plain Text
복사

3. Configure StovePCSDKPlugin at Visual Studio Solution

Suppose you have completed creating the Visual Studio solution file. In that case, you require the following steps to integrate Plugin in the HelloStove project.
3.A. Configure StoveSDK_Unreal build module
To recognize the Plugin module in HelloStove_Unreal, add the module name dependency to the HelloStove.uproject and HelloStove.Build.cs files.
Double-click the HelloStove.sln file to run Visual Studio, open the HelloStove.uproject file in the solution explorer. Add StoveSDKPlugin, the plugin's name, in the "AdditionalDependencies" item shown in the code below.
HelloStove.uproject
{ "FileVersion": 3, "EngineAssociation": "4.21", "Category": "", "Description": "", "Modules": [ { "Name": "HelloStove", "Type": "Runtime", "LoadingPhase": "Default", "AdditionalDependencies": [ "UMG", "Engine", "CoreUObject", "StoveSDKPlugin" ] } ] }
C++
복사
In HelloStove.Build.cs, add (AddRange) StoveSDKPlugin to PublicDependencyModuleNames and PrivateDependencyModuleNames modules as shown in the code below, respectively, to import the plugin into the UNREAL engine.
HelloStove.Build.cs
using UnrealBuildTool; public class HelloStove : ModuleRules{ public HelloStove(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Projects", "StoveSDKPlugin" }); PrivateDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Projects", "StoveSDKPlugin" }); // Uncomment if you are using Slate UI // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); // Uncomment if you are using online features // PrivateDependencyModuleNames.Add("OnlineSubsystem"); // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true } }
C#
복사
3.B. Change parent class of UMyStoveSDKObject
If you added the plugin's build module dependency through the above steps, proceed with the procedure below to use the Stove SDK function. Change the parent class of the derived class UMyStoveSDKObject from the existing UStoveSDKEmptyObject class to the new UStoveSDKObect class.
Before changing the parent class, the UMyStoveSDKObject class inherits the skeleton class UStoveSDKEmptyObject, but no function works. To use all the plugin functions, you need to include the header file StoveSDKObject.h and change it to inherit the UStoveSDKObect class.
Before
#pragma once#include "CoreMinimal.h"#include "StoveSDKEmptyObject.h"#include "MyStoveSDKObject.generated.h"DECLARE_DELEGATE_OneParam(FDele_Delegate_Log, FString); UCLASS() class HELLOSTOVE_API UMyStoveSDKObject : public UStoveSDKEmptyObject { GENERATED_BODY() protected: // Called when the game starts or when spawned ...
C++
복사
After
#pragma once#include "CoreMinimal.h"#include "StoveSDKObject.h"#include "MyStoveSDKObject.generated.h"DECLARE_DELEGATE_OneParam(FDele_Delegate_Log, FString); UCLASS() class HELLOSTOVE_API UMyStoveSDKObject : public UStoveSDKObject { GENERATED_BODY() protected: // Called when the game starts or when spawned ...
C++
복사
After completing the parent class change, delete StoveSDKEmptyObect.h from the project or comment out the header. The build will proceed without any problem.
3.C. Set UMyStoveSDKObect Member variables in UMyGameInstance
Remove the comment in the code below marked with /*remark delete*/ in HelloStove UMyGameInstance.
UMyGameInstance.h
#include "CoreMinimal.h"#include "Engine/GameInstance.h"/*remark delete*/ /*#include "MyStoveSDKObject.h"*/ #include "MyGameInstance.generated.h"UCLASS() class HELLOSTOVE_API UMyGameInstance : public UGameInstance { GENERATED_BODY() public: UMyGameInstance() { /*remark delete*/ /*_stoveSDKObject = NewObject<UMyStoveSDKObject>();*/ } private: /*remark delete*/ /*UPROPERTY() UMyStoveSDKObject* _stoveSDKObject;*/ };
C++
복사
3.D. Button event connection of MyUserWidget
There is a button in HelloStove to test the StoveSDK API call. To integrate Plugin and connect with button event, remove the comment in the code below marked with /*remark delete*/ of the UMyHelloStoveWidget class.
UMyHelloStoveWidget.cpp
/*remark delete*/ /*auto stoveSDKObject = Cast<UMyStoveSDKObject>(FindStoveSDKObject()); stoveSDKObject->_OnDeleLog.BindUObject(this, &UMyHelloStoveWidget::OnEventLog);*/ void UMyHelloStoveWidget::OnClickInit() { /*remark delete*/ /*auto stoveSDKObject = Cast<UMyStoveSDKObject>(FindStoveSDKObject()); stoveSDKObject->StoveSDKInit(FStoveConfig{});*/ } void UMyHelloStoveWidget::OnClickToken() { /*remark delete*/ /*auto stoveSDKObject = Cast<UMyStoveSDKObject>(FindStoveSDKObject()); stoveSDKObject->StoveSDKGetToken();*/ } void UMyHelloStoveWidget::OnClickUser() { /*remark delete*/ /*auto stoveSDKObject = Cast<UMyStoveSDKObject>(FindStoveSDKObject()); stoveSDKObject->StoveSDKGetUser();*/ } void UMyHelloStoveWidget::OnClickUnInit() { /*remark delete*/ /*auto stoveSDKObject = Cast<UMyStoveSDKObject>(FindStoveSDKObject()); stoveSDKObject->StoveSDKUnInit();*/ }
C++
복사