public override bool AddChild(Connector connector, Node node, int index) { if (node is WithPrecondition) { return base.AddChild(connector, node, index); } else { WithPrecondition withPrecondition = new WithPrecondition(); if (base.AddChild(connector, withPrecondition, index)) { withPrecondition.ResetId(false); return withPrecondition.AddChild(withPrecondition.GetConnector("Action"), node); } } return false; }
public override bool AddChild(Connector connector, Node node, int index) { if (node is WithPrecondition) { return(base.AddChild(connector, node, index)); } else { WithPrecondition withPrecondition = new WithPrecondition(); if (base.AddChild(connector, withPrecondition, index)) { withPrecondition.ResetId(false); return(withPrecondition.AddChild(withPrecondition.GetConnector("Action"), node)); } } return(false); }