Description
The Version
property of the ConfigData
class represents the version number of the configuration data. This property is an integer value and is marked as virtual, allowing derived classes to override it if necessary. It is important to note that this property is decorated with the JsonIgnore
attribute, meaning it will not be serialized or deserialized when using JSON serialization. Additionally, it is hidden from the editor interface due to the Hide
attribute.
Usage
Use the Version
property to track or manage the versioning of configuration data within your application. Since it is not serialized, it is primarily used for internal logic rather than being exposed in configuration files or external data exchanges.
Example
public class MyConfigData : ConfigData
{
public override int Version { get; set; } = 1;
public MyConfigData()
{
// Custom initialization logic
}
public void UpdateVersion()
{
// Example logic to update the version
Version++;
}
}