vault backup: 2024-10-12 17:19:45
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# NiagaraClearEachFrame
|
||||
|
||||
- **功能描述:** ScriptStruct /Script/Niagara.NiagaraSpawnInfo
|
||||
- **使用位置:** USTRUCT
|
||||
- **引擎模块:** Niagara
|
||||
- **元数据类型:** bool
|
||||
- **常用程度:** 0
|
||||
|
||||
指定某结构的数据在Niagara后续每一帧不应该读取,只作为初始数据。
|
||||
|
||||
当前只用在FNiagaraSpawnInfo上,仅仅内部用。
|
||||
|
||||
## 源码例子:
|
||||
|
||||
```cpp
|
||||
/** Data controlling the spawning of particles */
|
||||
USTRUCT(BlueprintType, meta = (DisplayName = "Spawn Info", NiagaraClearEachFrame = "true"))
|
||||
struct FNiagaraSpawnInfo
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
## 原理:
|
||||
|
||||
```cpp
|
||||
// If the NiagaraClearEachFrame value is set on the data set, we don't bother reading it in each frame as we know that it is is invalid. However,
|
||||
// this is only used for the base data set. Other reads are potentially from events and are therefore perfectly valid.
|
||||
if (DataSetIndex == 0 && Var.GetType().GetScriptStruct() != nullptr && Var.GetType().GetScriptStruct()->GetMetaData(TEXT("NiagaraClearEachFrame")).Equals(TEXT("true"), ESearchCase::IgnoreCase))
|
||||
{
|
||||
Fmt = VariableName + TEXT("{0} = {4};\n");
|
||||
}
|
||||
```
|
@@ -0,0 +1,86 @@
|
||||
# NiagaraInternalType
|
||||
|
||||
- **功能描述:** 指定该结构的类型为Niagara的内部类型。
|
||||
- **使用位置:** USTRUCT
|
||||
- **引擎模块:** Niagara
|
||||
- **元数据类型:** bool
|
||||
- **常用程度:** 0
|
||||
|
||||
指定该结构的类型为Niagara的内部类型。
|
||||
|
||||
用来和用户自定义的类型区分。用户不需要自己使用该元数据。
|
||||
|
||||
## 源码例子:
|
||||
|
||||
```cpp
|
||||
USTRUCT(meta = (DisplayName = "Half", NiagaraInternalType = "true"))
|
||||
struct FNiagaraHalf
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 Value = 0;
|
||||
};
|
||||
|
||||
USTRUCT(meta = (DisplayName = "Half Vector2", NiagaraInternalType = "true"))
|
||||
struct FNiagaraHalfVector2
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 x = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 y = 0;
|
||||
};
|
||||
|
||||
USTRUCT(meta = (DisplayName = "Half Vector3", NiagaraInternalType = "true"))
|
||||
struct FNiagaraHalfVector3
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 x = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 y = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 z = 0;
|
||||
};
|
||||
|
||||
USTRUCT(meta = (DisplayName = "Half Vector4", NiagaraInternalType = "true"))
|
||||
struct FNiagaraHalfVector4
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 x = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 y = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 z = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = Parameters)
|
||||
uint16 w = 0;
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
## 原理:
|
||||
|
||||
```cpp
|
||||
#if WITH_EDITORONLY_DATA
|
||||
bool FNiagaraTypeDefinition::IsInternalType() const
|
||||
{
|
||||
if (const UScriptStruct* ScriptStruct = GetScriptStruct())
|
||||
{
|
||||
return ScriptStruct->GetBoolMetaData(TEXT("NiagaraInternalType"));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
```
|
Reference in New Issue
Block a user