Class ConfigurationBuilder
Container for configuration values that need to be passed to the IProjectConfiguration component at runtime.
Namespace: Unity.Services.Core.Configuration.Editor
Syntax
public class ConfigurationBuilder
Methods
SetBool(String, Boolean, Boolean)
Stores the given value
for the given key
.
Declaration
public ConfigurationBuilder SetBool(string key, bool value, bool isReadOnly = false)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
Boolean | value | The value to store. It is stored as a string using InvariantCulture. |
Boolean | isReadOnly | Set to true to forbid game developers to override this setting. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | Return this instance. |
SetFloat(String, Single, Boolean)
Stores the given value
for the given key
.
Declaration
public ConfigurationBuilder SetFloat(string key, float value, bool isReadOnly = false)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
Single | value | The value to store. It is stored as a string using InvariantCulture. |
Boolean | isReadOnly | Set to true to forbid game developers to override this setting. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | Return this instance. |
SetInt(String, Int32, Boolean)
Stores the given value
for the given key
.
Declaration
public ConfigurationBuilder SetInt(string key, int value, bool isReadOnly = false)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
Int32 | value | The value to store. It is stored as a string. |
Boolean | isReadOnly | Set to true to forbid game developers to override this setting. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | Return this instance. |
SetString(String, String, Boolean)
Stores the given value
for the given key
.
Declaration
public ConfigurationBuilder SetString(string key, string value, bool isReadOnly = false)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
String | value | The value to store. |
Boolean | isReadOnly | Set to true to forbid game developers to override this setting. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | Return this instance. |
TryGetBool(String, out Boolean)
Try to get configuration entry as bool value from an identifier.
Declaration
public bool TryGetBool(string key, out bool value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
Boolean | value | The value to retrieve. If fail to retrieve the value is set to default. |
Returns
Type | Description |
---|---|
Boolean | True if the configuration exist and is boolean. False otherwise. |
TryGetFloat(String, out Single)
Try to get configuration entry as float value from an identifier.
Declaration
public bool TryGetFloat(string key, out float value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
Single | value | The value to retrieve. If fail to retrieve the value is set to default. |
Returns
Type | Description |
---|---|
Boolean | True if the configuration exist and is float. False otherwise. |
TryGetInt(String, out Int32)
Try to get configuration entry as int value from an identifier.
Declaration
public bool TryGetInt(string key, out int value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
Int32 | value | The value to retrieve. If fail to retrieve the value is set to default. |
Returns
Type | Description |
---|---|
Boolean | True if the configuration exist and is integer. False otherwise. |
TryGetString(String, out String)
Try to get configuration entry as string value from an identifier.
Declaration
public bool TryGetString(string key, out string value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The identifier of the configuration entry. |
String | value | The value to retrieve. If fail to retrieve the value is set to default. |
Returns
Type | Description |
---|---|
Boolean | True if the configuration exist. False otherwise. |