Get/set field and get/set property

Forums 💬 NodeCanvas 🗨️ General Discussion Get/set field and get/set property

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13734
    timv
    Participant

      I think it’s quite unfortunate that getting/setting fields is a different operation compared to getting/setting a property. While programming C#, you can change one into the other without any problems. In NodeCanvas however, all of the tasks that are getting/setting this value become invalid and will need to be adjusted after changing a field value to a property or vice versa. It’s also quite easy to make a mistake if you didn’t remember correctly if the thing you are getting/setting is a field or a property. It adds an additional layer of complexity for the author of the behavior tree in my opinion. Would it be possible to merge setting/getting fields and properties?

      #13736
      Gavalakis
      Keymaster

        Hey,

        While I understand the added complexity, it is actually not really that simple since fields and properties reflection wise are working quite differently as well as being differently serialized in NodeCanvas. I would have to create a new unified “Script Control” task that handles both properties and fields in the same code with sub-cases, but because I understand that it can be very convenient, I will give it a go when I refactor the Script Control tasks (which I was already planning to) 🙂

        Thanks for your suggestion!

        #13735
        timv
        Participant

          Cool. Thanks for considering the idea!

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