本帖最后由 123254484 于 2019-1-3 22:52 编辑  
 
最近要写个插件控制UE4地形编辑器,遇到俩问题 
第一个问题比较好操作并复现:随便建一个空的C++项目,然后在UE4里新建C++类继承自LandscapeEditorObject,然后就会报错,手动编译也不通过 
 
第二个问题是 
 
#include "Runtime/Landscape/Classes/Landscape.h"#include "Runtime/Landscape/Classes/LandscapeProxy.h" 
#include "Runtime/Landscape/Classes/LandscapeInfo.h" 
#include "Runtime/Landscape/Classes/LandscapeLayerInfoObject.h" 
#include "Editor/UnrealEd/Public/EditorModeTools.h" 
#include "Editor/UnrealEd/Public/EditorModes.h" 
#include "Editor/UnrealEd/Public/EditorModeManager.h" 
#include "Editor/LandscapeEditor/Private/LandscapeEdMode.h" 
 
FEdModeLandscape* LandscapeEdMode = (FEdModeLandscape*)GLevelEditorModeTools().GetActiveMode(FBuiltinEditorModes::EM_Landscape); 
//像这样访问变量没问题 
LandscapeEdMode->CurrentBrush; 
 
//但是访问函数方法就会报错 
LandscapeEdMode->CopyDataToGizmo();   
 
 
 
 
 
 
 这两个我觉得应该是同一个问题,相关的模块在.cs里面已经导入了 
 
PublicDependencyModuleNames.AddRange( 
                        new string[] 
                        { 
                                "Core", 
                "Projects", 
                "InputCore", 
                "UnrealEd", 
                "LevelEditor", 
                "Landscape", 
                "LandscapeEditor", 
                "CoreUObject", 
                "Engine", 
                "Slate", 
                "SlateCore","RenderCore", "RHI", "RawMesh" 
                                // ... add other public dependencies that you statically link with here ... 
                        } 
                        ); 
                         
                 
                PrivateDependencyModuleNames.AddRange( 
                        new string[] 
                        { 
                                "Projects", 
                                "InputCore", 
                                "UnrealEd", 
                                "LevelEditor", 
                "Landscape", 
                "LandscapeEditor", 
                                "CoreUObject", 
                                "Engine", 
                                "Slate", 
                                "SlateCore","RenderCore", "RHI", "RawMesh" 
                                // ... add private dependencies that you statically link with here ...         
                        } 
                        ); 
 
        PublicDelayLoadDLLs.Add("F:/Epic Games/UE_4.21/Engine/Binaries/Win64/UE4Editor-LandscapeEditor.dll"); 
 
 
 
 
有人知道什么原因么? 
 
 
 
 
 
 |