Generic Functions constraint problem.

FlowCanvas Forums Support Generic Functions constraint problem.

  • This topic has 5 replies, 2 voices, and was last updated 4 years ago by Gavalakis.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2981
    heftycoder
    Participant

      Hello, I’ve noticed that a generic function for a type only pops up if the constraint is :class, :Object, :Component, :MonoBehaviour. It doesn’t work if the constraint is a :ScriptableObject and its derivatives. The types for ScriptableObject pop up if :Object or :class is the constraint.

      Is this an issue or am I missing something? Thanks in advance!

      #2983
      Gavalakis
      Keymaster

        Hello there,

        Hmm. I’ve just tried and the methods show up fine.
        Does the method you try to call has any return value or parameters?
        Also is the type wherein the method is declared added to the Preferred Types list?

        Let me know.
        Thanks!

        #2989
        heftycoder
        Participant

          Hello again.

          Yes, the type is added in the Preferred Types list. I’m uploading two screenshots, they are pretty self-explanatory. [Unity 2020.2.7f1]

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

            Hello,
            It doesnt really have to do with the constraint being a ScriptableObject. The problem is that that specified method does not have any return value, neither a parameter and I can confirm that generic “void” methods with no parameters do not show up in the browser. On the other hand however and in a real case, you will either have a return value or a parameter since we are talking about generic methods specifically. I will take a look at this however.
            Let me know 🙂

            #3002
            heftycoder
            Participant

              Hello,

              Indeed, the browser does have all the functions, even the void one with no parameters. The problem was that the context menu for methods for that class (when dragging from a port that is that class) defaults the generic <T> to the class itself. Since the class isn’t a scriptable, the other methods don’t show up.

              Thanks a lot, overall this is an amazingly built asset.

              P.S : If you are Greek, “Σε ευχαριστώ φίλε, το asset είναι πολύ καλοφτιαγμένο :P”

              #3005
              Gavalakis
              Keymaster

                Hey,

                Thanks for the follow up!

                I am Greek indeed 🙂 “Σε ευχαριστω πολυ για τα καλα σου λογια φιλε μου. Χαιρομαι που σου αρεσει!”

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