Generic parameter not assigned?

NodeCanvas Forums Support Generic parameter not assigned?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16495
    orion
    Participant

    So I have an issue with a custom ActionTask that uses generic parameters in an FSM.

    When I run the FSM, the parameters don’t get assigned and the parameter values end up being null.

    The ActionTask:
    devenv_1XDpY2NDsr

    The base class that makes it work with UniTask for async execution (this generally works, since all my other tasks are based on this):
    devenv_bjbPDapbug

    The action in the FSM:
    Unity_OVdlLV5uR0

    The blackboard:
    Unity_tfN8p7CTnP

    …continued in reply…

    Attachments:
    You must be logged in to view attached files.
    #16500
    orion
    Participant

    It does recognize the type of T (it logs DataLoot). If I assign the parameters at runtime, it also picks up on them:
    Unity_Yl9JXxJlWT

    However, it still does not get assigned.

    Just executed with dynamic variables:
    devenv_uhGXoP6iEc

    Assigned manually at runtime:
    devenv_VUupW3hIEt

    I’d like to keep this generic and not make a separate function for every type that I might want to run this on. Is there a way to work around this?

    Attachments:
    You must be logged in to view attached files.
    #16504
    orion
    Participant

    Thank you everyone for rubber ducking. The solution was to add “where T : class” to the action. After plenty of reloading and regenerating AOTClasses it now works fine.

    PS: Could you please add a way to automate “Generate AOTClasses.cs and link.xml Files”, since I don’t see why my input is needed to find the same paths over and over, but I have to run this like 10 times a day and it’s gotten pretty annoying.

    EDIT: Oh, and yeah, obviously with the change above I’m sacrificing being able to use value types, but this is good enough for me. If someone has a solution that will also work for value types, that would be interesting.

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