73
62

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UE4 よく使うUPROPERTYメモ

Last updated at Posted at 2016-02-28

詳細ウインドウ周り

アクセス権系の属性

  • 属性毎のアクセス出来る範囲
レベルエディター:閲覧 レベルエディター:編集 ブループリントエディター等:閲覧 ブループリントエディター等:編集
EditAnywhere
EditDefaultsOnly × ×
EditInstanceOnly × ×
VisibleAnywhere × ×
VisibleDefaultsOnly × × ×
VisibleInstanceOnly × × ×
  • 実行結果
PropertyActor.h

// 見づらいので他のカテゴリは非表示
UCLASS(HideCategories = (Actor, Input, Rendering, Replication, ActorTick, Transform))
class TESTCPP_API APropertyActor : public AActor
{
	GENERATED_BODY()
public: // Edit系
	UPROPERTY(EditAnywhere, Category = "Edit")
	int32 EditAnywhere;
	UPROPERTY(EditDefaultsOnly, Category = "Edit")
	int32 EditDefaultsOnly;
	UPROPERTY(EditInstanceOnly, Category = "Edit")
	int32 EditInstanceOnly;

public: // Visible系
	UPROPERTY(VisibleAnywhere, Category = "Visible")
	int32 VisibleAnywhere;
	UPROPERTY(VisibleDefaultsOnly, Category = "Visible")
	int32 VisibleDefaultsOnly;
	UPROPERTY(VisibleInstanceOnly, Category = "Visible")
	int32 VisibleInstanceOnly;
	
	// (以下省略

レベルエディターの詳細パネル/ブループリントの詳細パネル
imageimage

その他

AdvancedDisplay

カテゴリの下に詳細設定として隠す事が出来ます

UPROPERTY(EditAnywhere, AdvancedDisplay, Category = "AdvancedDisplay")
int32 AdvancedDisplay;

image

EditFixedSize

配列の要素数を変更を禁止します。

UPROPERTY(EditAnywhere, EditFixedSize, Category = "EditFixedSize")
TArray<FName> EditFixedSize;
UPROPERTY(EditAnywhere, Category = "EditFixedSize")
TArray<FName> NoEditFixedSize;

image

Instanced(EditInlineは非推奨です)

インスタンス+変数値を入れる事が出来ます。
対象のクラスにはUCLASS(EditInlineNew)をつけるようにしてください。

SampleObject.h
UCLASS(EditInlineNew)
class モジュール名_API USampleObject : public UObject
{
	GENERATED_BODY()
public:
	UPROPERTY(EditAnywhere, Category="Variable")
	int32 Variable;	
};
UPROPERTY(EditAnywhere, Instanced, Category = "Instanced")
USampleObject* Instanced;

image

条件付

「meta = (EditCondition = 変数名)」で条件付きの変数を作る事が出来ます

UPROPERTY(EditAnywhere, Category = "Condition", meta = (EditCondition = bEditCondition))
int32 EditConditionVariable;
UPROPERTY()
bool bEditCondition;

image

ブループリント関連

ブループリントアクセス権限

UPROPERTY(BlueprintReadOnly, Category = "Variable|Blueprint")
int32 BlueprintReadOnly; // Getのみ公開
UPROPERTY(BlueprintReadWrite, Category = "Variable|Blueprint")
int32 BlueprintReadWrite; // Get・Set両方公開

image

スポーン時に公開

UPROPERTY(BlueprintReadWrite, Category = "Variable", Meta = (ExposeOnSpawn = true))
FVector Location;

image

その他

Show 3D Widget

Meta = (MakeEditWidget = true)を有効にすることで「3Dウィジェットを表示する」が有効になります

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Variable", Meta = (MakeEditWidget = true))
FVector Location;

image

73
62
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
73
62

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?