Files
XCEngine/docs/api/XCEngine/Scripting/ScriptFieldStorage/SetFieldValue.md

30 lines
652 B
Markdown

# ScriptFieldStorage::SetFieldValue
**命名空间**: `XCEngine::Scripting`
**类型**: `method`
**头文件**: `XCEngine/Scripting/ScriptFieldStorage.h`
## 签名
```cpp
template<typename T>
bool SetFieldValue(const std::string& fieldName, const T& value);
bool SetFieldValue(
const std::string& fieldName,
ScriptFieldType type,
const ScriptFieldValue& value);
```
## 当前实现行为
- 模板重载会先通过 `ScriptFieldTypeResolver<T>` 推导类型。
- 显式重载会拒绝空字段名或类型/值不兼容的输入。
- 成功时覆盖或写入对应字段。
## 相关文档
- [TryGetFieldValue](TryGetFieldValue.md)