I’m currently learning the editor UI of Unreal Engine and I want to relate it to the C++ structure behind it.
I’m noting names like this: ‘Name’ and types like this: Type
.
Setup:
I made a new basic C++ project. It creates the plane with a table and 2 chairs. It also has a SkyLight
named ‘SkyLight’. In the ‘Details’ panel you can see it has components (as in “made of”) like Transform
, Light
, Rendering
, Distance Field Ambient Occlusion
, Sky Light
etc. It also has a component (as in “attached hierarchical child”) - a SkyLightComponent
named ‘LightComponent’. I hope I got it right so far.
Questions:
1. How can I see the code behind the ‘SkyLight’? Here’s Skylight.h (accessing popup menu in ‘World Outliner’ - ‘Open SkyLight.h’):
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "GameFramework/Info.h"
#include "SkyLight.generated.h"
UCLASS(ClassGroup=Lights, hidecategories=(Input,Collision,Replication,Info), showcategories=("Rendering", "Input|MouseInput", "Input|TouchInput"), ComponentWrapperClass, ConversionRoot, Blueprintable)
class ENGINE_API ASkyLight : public AInfo
{
GENERATED_UCLASS_BODY()
virtual void GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const override;
private:
/** @todo document */
UPROPERTY(Category = Light, VisibleAnywhere, BlueprintReadOnly, meta = (ExposeFunctionCategories = "Light,Rendering,Rendering|Components|SkyLight", AllowPrivateAccess = "true"))
class USkyLightComponent* LightComponent;
public:
/** replicated copy of LightComponent's bEnabled property */
UPROPERTY(replicatedUsing=OnRep_bEnabled)
uint32 bEnabled:1;
/** Replication Notification Callbacks */
UFUNCTION()
virtual void OnRep_bEnabled();
/** Returns LightComponent subobject **/
class USkyLightComponent* GetLightComponent() const { return LightComponent; }
};
I can’t see any of Transform
, Light
, Rendering
, Distance Field Ambient Occlusion
, Sky Light
etc. Where are these coming from if they’re not fields of a SkyLight
?
2. Can I add extra these “made of” components to ‘SkyLight’ in world or am I forced to add an actor component?
3. ‘LightComponent’ in ‘Details’ represents the very private field class USkyLightComponent* LightComponent;
am I right?