|
Doloro GDK 22 .1.0 Beta
by Tauri Interactive
|
Asset Property is an atomic block of DDM APS module's architecture. It provides an interface to storing and operating of an abstract value for any case:
See also:
DDM ASP supplies you with a lot of frequently using types "from a box".
| Operating type | Property Type | Supported operators |
|---|---|---|
bool | Doloro.DataManagement.AssetPropertiesSystem.BoolAssetProperty | Not Or And Xor |
bool | Doloro.DataManagement.AssetPropertiesSystem.FlagAssetProperty | |
float Single | Doloro.DataManagement.AssetPropertiesSystem.FloatAssetProperty | + - / * ++ -- == != |
int Int32 | Doloro.DataManagement.AssetPropertiesSystem.IntAssetProperty | + - / * ++ -- == != |
string | Doloro.DataManagement.AssetPropertiesSystem.StringAssetProperty | + |
Vector2 | Doloro.DataManagement.AssetPropertiesSystem.Vector2AssetProperty | + - / * == != |
Vector3 | Doloro.DataManagement.AssetPropertiesSystem.Vector3AssetProperty | + - / * == != |
Vector4 | Doloro.DataManagement.AssetPropertiesSystem.Vector4AssetProperty | + - / * == != |
Notes:
AssetProperty containers representing the prototype type, where not causes ref issues.FlagAssetProperty is always true value using when you need to store not a dynamic state but a fact that something is on. It's a preferred way to work with binary properties where it possible.Domains is the on of the core concepts using in properties.
It works like a namespace concept during regular source development, letting you use the same name several time but in different scopes.
A property with empty domain always locates to the Root domain.
Such a property can be accessed both with empty domain by the property name only, or by addressing it via the root\PROP_NAME path where the PROP_NAME is the name of the property.
Domain or property can't have the same path.
In case if a property of domain conflicts each other such a set will cause an exception.
| Valid pair | Exception | |
|---|---|---|
| Domain path | Player.Body | Player.Body |
| Property path | Player.Body.health | Player.body |
Following exception example simulates the situation when you attempt to create body property in Player domain, but there already exits a domain Player\Body those conflicts with the property path. Same goes to other side.
Any property must implement serialization compatibility. The entire from-box types have such compatibility, so you can easily serialize \ deserialize any property supplied container manually or by using Serialization Tools solutions.
You can create your own AssetProperty implementations to extend the system with a custom data types required into your development.
Property class divided on two parts:
Following tutorial introduce you into entire development stages.
To create a new runtime property implementation, you need to create a new class derived from the AssetProperty following the pattern provided below.
AssetPropertySerializable attribute to itISerializable interface.| Placeholder | Meaning |
|---|---|
| PROPERTY_NAME | Name of the new property class. Should be named in format OperatingType+AssetPropety. |
| VALUE_TYPE | Type of the property prototype. |
Serializable attribute.ISerializable interface.After creating the runtime part, you need to create editor part to let the tool know how to display and treat the property in Editor GUI.
Editor folder.AssetPropertyEditor.PropertyInspector attribute to the class.OnInpectorGUI(UnityEngine.Rect rect) member with your custom GUI implementation that handles the value supplied by the source property.See also: Doloro.DataManagement.AssetPropertiesSystem.AssetPropertyEditor
the possible option to get an example is exploration of ddm-aps-com-ap-types. Entire classes you may find in project by following directories:
| Type | Path |
|---|---|
| Runtime | Doloro-GDK \ Doloro-Data-Management \ Runtime \ Asset Properties System \ Properties \ |
| Editor | Doloro-GDK \ Doloro-Data-Management \ Editor \ Asset Properties System \ Properties \ |