载入中...
搜索中...
未找到
ActionPrefabBlock.cpp
浏览该文件的文档.
15 Diagnostic::error(DiagnosticCode::InvalidArgument, "prefab field must be text", std::string(key)));
18 Diagnostic::error(DiagnosticCode::InvalidArgument, "prefab field must not be empty", std::string(key)));
22Result<double> optionalNumber(const Value::Object& payload, std::string_view key, double fallback) {
32 Diagnostic::error(DiagnosticCode::InvalidArgument, "prefab duration must be numeric", std::string(key)));
35 Diagnostic::error(DiagnosticCode::InvalidArgument, "prefab duration must be finite", std::string(key)));
50Result<ActionPrefabSpawnBinding> ActionPrefabSpawnBinding::fromPayload(const Value::Object& payload) {
61 Diagnostic::error(DiagnosticCode::InvalidArgument, "prefab lifecycle must be text", "lifecycle"));
78 DiagnosticCode::InvalidArgument, "custom prefab duration must be positive", "customDurationSeconds"));
82 DiagnosticCode::InvalidArgument, "custom prefab duration must be positive", "customDurationSeconds"));
110 Diagnostic::error(DiagnosticCode::InvalidArgument, "VFX field must be numeric", std::string(key)));
113 Diagnostic::error(DiagnosticCode::InvalidArgument, "VFX field must be finite", std::string(key)));
119Result<ActionVfxBinding> ActionVfxBinding::fromPayload(const Value::Object& payload, ActionVfxShape shape) {
122 if (uri == payload.end() || !uri->second.getIf<std::string>() || uri->second.getIf<std::string>()->empty())
135 Diagnostic::error(DiagnosticCode::InvalidArgument, "VFX stopBehavior must be text", "stopBehavior"));
149 DiagnosticCode::InvalidArgument, "VFX playbackRateSynced must be boolean", "playbackRateSynced"));
162 DiagnosticCode::InvalidArgument, "VFX clipEndTime must be greater than clipStartTime", "clipEndTime"));
170 DiagnosticCode::InvalidArgument, "instant VFX lifetimeSeconds must be positive", "lifetimeSeconds"));
173 DiagnosticCode::InvalidArgument, "VFX lifetimeSeconds must be non-negative", "lifetimeSeconds"));
Typed payload contract for prefab-spawn action states.
Typed VFX action-block payload contract.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result< Duration > fromSeconds(double seconds)
Convert finite seconds to the nearest nanosecond.
Definition Time.cpp:17
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Definition AbilityAsset.cpp:13
std::string_view prefabSpawnLifecycleName(PrefabSpawnLifecycle lifecycle) noexcept
Return the stable serialized spelling for a prefab lifecycle.
Definition ActionPrefabBlock.cpp:41
ActionVfxShape
Authored VFX block shape used to select lifetime validation.
Definition ActionVfxBlock.h:19
@ Instant
@ ClearImmediately
@ StopEmitting
PrefabSpawnLifecycle
Authority responsible for ending a spawned prefab instance.
Definition ActionPrefabBlock.h:21
@ CustomDuration
The action block recycles the instance after customDuration.
@ RecycleOnBlockExit
The action block recycles the instance on Exit or interruption.
@ Independent
Ownership is transferred to the prefab instance service after spawning.
@ InvalidArgument
Fully validated, owning settings for one prefab-spawn state block.
Definition ActionPrefabBlock.h:36
Duration customDuration
Definition ActionPrefabBlock.h:39
ActionSpatialBinding spatial
Definition ActionPrefabBlock.h:40
PrefabSpawnLifecycle lifecycle
Definition ActionPrefabBlock.h:38
static Result< ActionPrefabSpawnBinding > fromPayload(const Value::Object &payload)
Decode a prefab-spawn payload without mutating runtime state.
Definition ActionPrefabBlock.cpp:50
static Result< ActionSpatialBinding > fromPayload(const Value::Object &payload)
Decode and validate the common spatial fields in an owning payload.
Definition ActionSpatialBlock.cpp:64
Owning validated VFX settings shared by runtime and editor preview.
Definition ActionVfxBlock.h:25
ActionVfxStopBehavior stopBehavior
Definition ActionVfxBlock.h:28
static Result< ActionVfxBinding > fromPayload(const Value::Object &payload, ActionVfxShape shape)
Decode one dynamic VFX payload transactionally.
Definition ActionPrefabBlock.cpp:119
bool playbackRateSynced
Definition ActionVfxBlock.h:29