The ResourceVersion
property represents the version of the component within the GameResource
class. This property is utilized by the JsonUpgrader
to manage versioning and ensure compatibility across different versions of the resource.
The ResourceVersion
property represents the version of the component within the GameResource
class. This property is utilized by the JsonUpgrader
to manage versioning and ensure compatibility across different versions of the resource.
The ResourceVersion
property is a virtual integer property, meaning it can be overridden in derived classes. It is marked with the JsonIgnore
and Hide
attributes, indicating that it is not serialized to JSON and is hidden from the editor interface.
To use this property, you can access it directly from an instance of a class that derives from GameResource
. If you are implementing a custom resource type, you may override this property to provide specific versioning logic.
public class MyCustomResource : GameResource { public override int ResourceVersion { get; set; } = 1; public MyCustomResource() { // Custom initialization logic } // Additional methods and properties }