Calling child class method from object type Node

Forums 💬 NodeCanvas ⚙️ Support Calling child class method from object type Node

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17458
    anonymous
    Participant

      Hello!
      I am trying to add a method, that is called when the node is deleted. For that, I want to call it in the Graph’s RemoveNode method.

      I can’t figure out how to access methods in my I2Say : ActionTask<IDialogueActor> class with the node object, that is passed in
      the public void RemoveNode(Node node, bool recordUndo = true) method.

      This is probably a stupid question but I can’t seem to figure it out. I would be happy for any help!

      #17460
      anonymous
      Participant

        I figured it out!

        I didn’t see node is type ActionNode. So I casted it into ActionNode and then took the action and casted it into I2Say, which is deriving from ActionTask:

        ActionNode an = (ActionNode)node;
        I2Say say = (I2Say)an.action;
        say.RemoveTermReference();

        #17459
        Gavalakis
        Keymaster

          Great 🙂
          Glad to know you’ve figured this out and thanks for the follow up!

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