Search Unity

PlayerData validate

Discussion in 'Timeline' started by dimmduh1, Feb 16, 2021.

  1. dimmduh1

    dimmduh1

    Joined:
    Feb 5, 2021
    Posts:
    24
    Is possible to validate track player data (target object) or override editor?

    I use [TrackBindingType(typeof(UnityEngine.Object))] to support multiple types in track.
    upload_2021-2-17_0-0-36.png
     
  2. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    177
    Yes. You can create a TrackEditor for your custom track and you will be able to override the GetBindingFrom method. This method will be called when an object is being dragged on your track. The return value can be any object/component that you want to bind to your track.

    Edit: GetBindingFrom is available since Timeline v1.5
     
    dimmduh1 likes this.