Get Configuration (GetConfig)
[Player Network SDK & MSDK] Dynamically obtain configuration values.If a key’s value has not been successfully set via GUAUpdateConfig, the value from the ini file is returned; otherwise, the dynamically set value is returned.
Supported platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.note
MSDK currently does not support Windows
Function Definition
- Unity
- Unreal Engine
T GetConfig<T>(string key, T defValue, string project = "INTL")
static std::string GetConfig(const std::string &key, const std::string &default_value, const std::string &project = "INTL");
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| key | bool, int, string | Configured Key |
| defValue | bool, int, string | Return value if retrieval fails, optional input |
| project | String | Default parameter, remains unchanged |
| Parameters | Type | Description |
|---|---|---|
| key | std::string | Configured Key |
| default_value | std::string | Return value if retrieval fails, optional input |
| project | std::string | Default parameter, remains unchanged |
Code example
- Unity
- Unreal Engine
UnionAdapterAPI.GetToolsService().GetConfig<string>("key");
GUA_NAMESPACE::GUAToolsService::GetConfig("key");