每当我退出虚幻引擎 5 编辑器时,我注意到当我再次打开它时,我的各种 C++ 类都消失了。
幸运的是,我所要做的就是重新编译,它们就会再次添加回来。然而,这确实造成了严重的不便,因为我必须将它重新附加到它所属的任何演员上,并且我必须重新进行我所做的任何细节面板编辑。
假设我正在尝试为我的跑酷游戏制作一系列移动平台,因此我制作了一个名为 PlatformMover 的 ActorComponent。我将它以不同的速度和方向附加到不同的平台上。然后我退出当天的编辑器,当我第二天重新打开它时,PlatformMover 就消失了。然后我重新编译我的项目,PlatformMover 又回来了,但我现在必须重新附加它并再次为每个平台重新配置它。
实在是太不方便了,那么有什么解决办法吗?
当我尝试使用 Visual Studio 版本二十九点七点二分编译虚幻引擎版本四点二十五分 (4.25) 时,出现以下错误。(vs2019.7.2) 或 (16.7.2)。
Microsoft Visual Studio 社区 2019 版本 16.7.2
有谁知道如何编译这个?
1>------ Build started: Project: HVS, Configuration: Development_Editor x64 ------
1>Using 'git status' to determine working set for adaptive non-unity build (C:\repos).
1>Invalidating makefile for HVSEditor (VisualStudioDTE.Build.cs modified)
1>Building HVSEditor and ShaderCompileWorker...
1>Using Visual Studio 2019 14.27.29111 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 5 actions with 12 processes...
1> [1/5] dte80a.tlh
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): …Run Code Online (Sandbox Code Playgroud) c++ visual-studio unreal-engine4 visual-studio-2019 unreal-engine5
自从我升级到 UE 5 以来,我不断收到此错误
错误 实时编码处于活动状态时无法构建。退出编辑器和游戏,或者如果在编辑器或游戏中迭代代码,请按 Ctrl+Alt+F11
有什么解决办法吗?
我想UPROPERTY()在我的项目中实现类似宏的东西,但我找不到任何关于它实际是什么的参考。我的意思是,有关于这个宏如何工作的教程,但这些只是用例。
编译器如何知道UPROPERTY()引用了它下面的变量?
例子:
UPROPERTY(EditAnywhere)
int x = 0;
Run Code Online (Sandbox Code Playgroud)
我知道虚幻是开源的,但它的代码库非常庞大。
所以我最近从Unity切换到Unreal,我无法理解Unreal中Owner的概念。我理解亲子关系,但主人到底是什么?更改演员的所有者并不会改变其层次结构,那么 unreal 到底是如何处理所有权的呢?
先感谢您。
编辑:删除了我发现的与渲染相关的细节,这对于所有权来说不是一个好的用例。
FVector ActorLocation = GetActorLocation();
UE_LOG(LogTemp, Log, TEXT("演员位置:%f"), ActorLocation);
正如标题所说,TBitArray<>没有确切的类型,那么这是否意味着该方法可以接受任何诸如TBitArray<int32>, TBitArray<float>, ... 作为参数?
FORCEINLINE bool HasAll(const TBitArray<>& Other) const
{
FConstWordIterator ThisIterator(*this);
FConstWordIterator OtherIterator(Other);
while (ThisIterator || OtherIterator)
{
const uint32 A = ThisIterator ? ThisIterator.GetWord() : 0;
const uint32 B = OtherIterator ? OtherIterator.GetWord() : 0;
if ((A & B) != B)
{
return false;
}
++ThisIterator;
++OtherIterator;
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
这段代码有什么区别
template<class T>
FORCEINLINE bool HasAll(const TBitArray<T>& Other) const
Run Code Online (Sandbox Code Playgroud) 我目前正在学习 C++(用于虚幻引擎)。我在示例代码中遇到了一段我不明白的代码:
class APangaeaCharacter : public ACharacter
{
GENERATED_BODY()
public:
APangaeaCharacter();
// Called every frame.
virtual void Tick(float DeltaSeconds) override;
/** Returns TopDownCameraComponent subobject **/
FORCEINLINE class UCameraComponent* GetTopDownCameraComponent() const { return TopDownCameraComponent; }
/** Returns CameraBoom subobject **/
FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
private:
/** Top down camera */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class UCameraComponent* TopDownCameraComponent;
/** Camera boom positioning the camera above the character */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category …Run Code Online (Sandbox Code Playgroud) I'm following a tutorial on user widgets and after I add TSubclassOf<UUserWidget> widgetClass; it gives me an error I can't figure it out:
MainPlayer.gen.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class UClass * __cdecl Z_Construct_UClass_UUserWidget_NoRegister(void)" (__imp_?Z_Construct_UClass_UUserWidget_NoRegister@@YAPEAVUClass@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UECodeGen_Private::FClassPropertyParams const Z_Construct_UClass_AMainPlayer_Statics::NewProp_widgetClass''(void)" (??__E?NewProp_widgetClass@Z_Construct_UClass_AMainPlayer_Statics@@2UFClassPropertyParams@UECodeGen_Private@@B@@YAXXZ)"
Run Code Online (Sandbox Code Playgroud)
the img:https://i.stack.imgur.com/VKGZO.png
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Camera/CameraComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "Blueprint/UserWidget.h" …Run Code Online (Sandbox Code Playgroud) 我试图创建一个新的C++虚幻引擎项目,但每次我这样做(仅使用 C++)时,都会弹出一个窗口,显示:
Running C:/Program Files/Epic Games/UE_5.0/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.exe -projectfiles -project="C:/Users/user/Documents/Unreal Projects/MyProject/MyProject.uproject" -game -rocket -progress
Log file: C:\Users\user\AppData\Local\UnrealBuildTool\Log_GPF.txt
Some Platforms were skipped due to invalid SDK setup: IOS, Android, Linux, LinuxArm64.
See the log file for detailed information
Discovering modules, targets and source code for project...
ERROR: Could not find NetFxSDK install dir; this will prevent SwarmInterface from installing. Install a version of .NET Framework SDK at 4.6.0 or higher.
Run Code Online (Sandbox Code Playgroud)