Databrain Documentation
databrain.ccDiscord
  • Welcome
  • Installation / Update
  • Interface
  • DataObject Property Drawer
    • No GUI Implemented - FIX
  • Getting started
  • Guides
    • Add data objects
    • Add data objects at runtime
    • Get initial data
    • Get/Set runtime data
    • Serialize DataObjects
    • Runtime Save & Load
    • Use custom serializer
    • Import
    • Search
    • Custom GUI
    • Custom GUI with Odin Inspector
    • Hierarchy Template
  • Separate DataObjects
  • Using Version Control
  • Attributes
    • DataObject attributes
    • Field attributes
  • API
    • DataLibrary
    • DataObject
  • FAQ
    • Databrain - FAQ
  • Add-ons
    • Events
    • Blackboard
    • Logic
      • Interface
      • Create Graph
      • Execute graph
      • Control flow execution in groups
      • Custom Nodes
        • Asynchronous execution
        • Node Attributes
      • Scene Components
      • Graph Events
      • Finite State Machine
        • Create custom Actions
        • Examples
        • State Machine Nodes
    • Stats
      • Achievements
      • Modifiers
      • Values
      • Progressions
      • Components
      • Nodes
    • Progress
      • Progress Settings
      • Progress Graph
      • Progress Resources
      • Runtime UI Setup
      • API
        • ProgressController
    • Techtree (LEGACY)
      • Techtree Manager
      • Techtree
      • TechtreeResource
      • Techtree UIBuilder
        • Custom Techtree Node Button
        • Tooltip
      • API
    • Localization
      • Localization Manager
      • Localization
      • Examples
      • Components
      • Import
      • API
    • Inventory
      • Getting started
      • Demo
      • Data setup
        • Inventories
        • Slot IDs
        • Items
          • Blueprints
          • Item rarities
        • Money
        • Loot tables
        • Events
      • Runtime UI
        • Setup
    • Dialogue
      • Getting Started
        • Demo
      • Dialogue runtime setup
      • Actors
        • Emotions
      • Localization
      • Audio
      • Animation
      • Variables
      • Custom theme
      • Import
      • Nodes
      • API
        • DialogueController
        • IDialogueUIControl
  • Changelog
    • Databrain - Changelog
      • 1.4.0
      • 1.3.2
      • 1.3.1
      • 1.3.0
      • 1.2.0
      • 1.1.0
      • 1.0.10
      • 1.0.9
      • 1.0.8
      • 1.0.7
      • <= 1.0.6
Powered by GitBook
On this page
  • DataObjectIcon
  • DataObjectTypeName
  • DataObjectOrder
  • DataObjectMaxObjects
  • DataObjectHideBaseFields
  • DataObjectHideAllFields
  • DataObjectAddToRuntimeLibrary
  • DataObjectIMGUIInspector
  • DataObjectLock
  • HideDataObjectType
  • DataObjectSingleton
  • DataObjectCustomNamespaceIcon
  • DataObjectFirstClassType
  • DataObjectLink
  • DataObjectShowSubTypes
  1. Attributes

DataObject attributes

DataObjectIcon

Set an icon for this DataObject

  • iconPath: name of icon located in Databrain/Core/Res/Icons or complete asset path: (Assets/MyType/Icons/customIcon.png)

  • iconColor: Color of the icon

[DataObjectIcon("alien", DatabrainColor.Red.GetColor)]
public class EnemyData : DataObject{}

DataObjectTypeName

Set a custom name for this type

  • typeName: the custom name

[DataObjectTypeName("Enemy")]
public class EnemyData : DataObject{}

DataObjectOrder

order this data type by the order index number

  • order: odering index

[DataObjectOrder(0)]
public class EnemyData : DataObject{}

DataObjectMaxObjects

Set max allowed data objects for this data type. Useful for manager types where only one data object would make sense.

  • maxObjects: number of allowed objects

DataObjectHideBaseFields

Hide certain fields from the general foldout. (icon, title, description)

  • hideIconField: if true, hide the icon field

  • hideTitleField: if true, hide the title field

  • hideDescriptionField: if true, hide the description field

DataObjectHideAllFields

Hide all fields, useful when creating a custom GUI and the default data inspector shouldn't display any fields.

DataObjectAddToRuntimeLibrary

Automatically add this DataObject to the runtime DataLibrary at start.

DataObjectIMGUIInspector

Force the inspector to draw fields with IMGUI. This is just to maintain downward compatibility for certain property drawers.

DataObjectLock

Lock data object creation for this type

HideDataObjectType

Hide this data type in the list view.

DataObjectSingleton

Mark this data object as a singleton object. A singleton DataObject can be easily retrieved using following API:

MyManager manager = dataLibrary.GetSingleton<MyManager>();

DataObjectCustomNamespaceIcon

Custom icon override for namespace foldout in the hierarchy. Only has to be added to one DataObject class which is in the corresponding namespace

DataObjectFirstClassType

Marks this DataObject type and all other types which are in the same namespace as first class types. These are being displayed first in the hierarchy with additional icon and custom title. Only has to be added to one DataObject class which is in the corresponding namespace.

DataObjectLink

Link this DataObject type to another DataObject type. This is useful for when a DataObject can't be in a namespace you'd like, because of the base type already being in a different namespace. In this case, simply create an empty DataObject inside of the namespace you want and add the attribute to it which points to the actual DataObject in the different namespace.

DataObjectShowSubTypes

Show not only current, but also subtypes (inherited types) of this DataObject type in data object list.

PreviousUsing Version ControlNextField attributes

Last updated 10 months ago

Add data objects at runtime