SerializeReference doesn’t work in custom task

NodeCanvas Forums Support SerializeReference doesn’t work in custom task

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16454
    veryhotshark
    Participant

    Hi I have a problem with my interface/class field not serializing like in normal unity inspector.

    I have a case where I have a base class called Skill and there are a lot sub classes inheriting from it.

    I wanted to create one custom Task called Cast Skill with field type “Skill”. When using SerializeReference in normal unity script it serializes correctly and let me pick one of the all subclasses of Skill and edit their unique properties.

    But when I have the same field inside my Task it doesn’t serialize it and I have to specify exactly what type of skill it is in order to modify it.

    I know I can change them to scriptable objects and have them dragged but I didnt want to create so many assets and have them inlined as class.

    My questions is, is there any way to bypass it or force NodeCanvas to use unity serializer  for SerialozeReference?

    Thank you

     

    Attachments:
    You must be logged in to view attached files.
    #16472
    Gavalakis
    Keymaster

    Hello there,

    Unfortunately SerializeReference is not supported in NodeCanvas serialization since NodeCanvas is using a different serializer and thus this kind of feature will need to be implemented in the NodeCanvas serialization anew if something similar is to be supported. I have noted your request to look at this. It should not be difficult to implement something similar.

    Join us on Discord: https://discord.gg/97q2Rjh

    #16483
    veryhotshark
    Participant

    Hi Thank you for reply,
    Is there and ETA for an update supproting this or could you please help me implement somethjing similar right now? I quite need this since it woul make my setup 10 times faster
    thank you

    #16623
    veryhotshark
    Participant

    Hi,
    it’s been a long time and I wanted to ask again is there some ETA for that Update?
    I really need this feature and I don’t know should I look somewhere else or wait for an udpate
    Thank you

    #16629
    Gavalakis
    Keymaster

    Hello again,

    I just created a Property Drawer which when used on a field, it will popup a selection of the field type implementations and create an instance of that selection. If you want to try it now please do the following:

    1) Open up DrawerAttributes.cs and add this code somewhere within the namespace:

    2) Open up AttributeDrawers.cs and add this code somewhere within the namespace as well:

    You can then use the [ReferenceField] attribute on your custom task interface type fields.
    Please let me know how this works for you.

    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.