Language
Edit

DataConsumerCollection.AddVariableKeyPathsForComponent(Component) Method

Definition

For all components managed by this data consumer, add keypath(s) to listen for.

protected override void AddVariableKeyPathsForComponent(UnityEngine.Component component);
override this.AddVariableKeyPathsForComponent : UnityEngine.Component -> unit
Protected Overrides Sub AddVariableKeyPathsForComponent (component As Component)

Parameters

component
UnityEngine.Component

The component of that type, typically the game object on which this script exists.

Remarks

For a collection, the only keypath typically is the keypath explicitly assigned to this collection by the inspector. This keypath is for the collection itself in the data source. For example, if this list is designed to show an address book of contacts, and the JSON data for the data source looks like this:

{
  "data_result" :
    {
       "result_code" : 0,
       "result_message" : "Success",
       "address_books" : {
          "primary_contacts" :
             {
                "type" : "business",
                "persons" :
                   [
                      { "first_name": "Jennifer", "last_name" : "Robbins", "email_address" : "jennifer_robbins@contoso.com" },
                      { "first_name": "Kierra", "last_name" : "Schaffer", "email_address" : "kierra_schaffer@contoso.com" },
                      { "first_name": "Alvaro", "last_name" : "McGee", "email_address" : "alvaro_mcgee@contoso.com" }
                   ]
             }
          }
       }
   }
}

Then the key path would be: data_result.address_books.primary_contacts.persons.

Applies to