Automatic type conversions improvements

Forums 💬 NodeCanvas ⚙️ Support Automatic type conversions improvements

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17254
    bcristian
    Participant

      Hello

      I’ve made some improvements (at least in my opinion 🙂 ) to the automatic type conversions:
      – GameObject to Component
      – Component to GameObject
      – Component to Component
      – GameObject/Component to Vector3 (position)
      – GameObject/Component to Quaternion (rotation)

      Automatic type conversion in things like GetOtherVariable, GetPropertyValue, ExecuteFunction, etc.

      This greatly simplifies the graphs, as it removes the need for GetComponent, get_gameObject, etc that only add clutter. Of course, it the graph is supposed to perform active validation of its inputs than those actions are still necessary, at least some times.

      Converter.cs

      Variable.cs

      GetOtherBlackboardVariable.cs

      GetPropertyOfVariable_Multiplatform.cs (an extension of GetProperty that can get properties of a variable of arbitrary type, as GetProperty gets from its agent, which must derive from Component).

      Moved all the conversion code to its own file, both to simplify Variable.cs and to be able to use it outside of Variable class.

      #17255
      Gavalakis
      Keymaster

        Hey,

        Thanks. Moving the conversions outside of Variable.cs is something I indeed wanted to do sometime now 🙂
        I already have a very similar (standalone) converter made for FlowCanvas, thus using this for both NodeCanvas and FlowCanvas would of course be better.

        The GetPropertyOfVariable is also very interesting and useful by the way 🙂

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