Search Unity

Question Show serialized class references with a dropdown menu

Discussion in 'Editor & General Support' started by Silenius_, Apr 7, 2021.

  1. Silenius_

    Silenius_

    Joined:
    Oct 23, 2017
    Posts:
    14
    Hello everyone,

    I'm trying to serialize an entire YAML file with Unity Editor. I wan't to create class references on Unity Editor and make those references choosable from different serialized class references.

    For example: I am creating a quest trigger like that:

    upload_2021-4-7_13-22-13.png

    And then I want to use those quest triggers from Tasks classes.
    upload_2021-4-7_13-26-22.png

    As you can see I already tried SerializedReferences but seems like they don't work with custom serialized classes. I also visually achieved my goal with NaughtyAttributes extension. However when I add a new task every dropdown value resets since I'm getting these values from YAML file.

    Is there any way to use an inspector serialized class reference in another inspector serialized class as field?