public static UdonComment Create(UdonGraphElementData elementData, UdonGraph graph) { var comment = new UdonComment(elementData.jsonData, graph); comment.UpdateFromData(); graph.MarkSceneDirty(); return(comment); }
// Called from Context menu public static UdonComment Create(string value, Rect position, UdonGraph graph) { var comment = new UdonComment("", graph); // make sure rect size is not 0 position.width = position.width > 0 ? position.width : 128; position.height = position.height > 0 ? position.height : 40; comment._customData.layout = position; comment._customData.title = value; return(comment); }