protected virtual void DrawHelp(NodeModifier node) { if (node == null) { return; } HelpAttribute help = Attribute.GetCustomAttribute(node.GetType(), typeof(HelpAttribute)) as HelpAttribute; if (help == null) { return; } GUIStyle style = new GUIStyle(); style.fontSize = 13; style.normal.textColor = Color.white;// new Color32(238, 130, 238, 255); style.clipping = TextClipping.Overflow; style.wordWrap = true; GUIContent con = new GUIContent(help.Help); //Vector2 size = style.CalcSize(con); float width = 200;// size.x > 200 ? 200 : size.x; float height = style.CalcHeight(con, width); Rect rect = new Rect(_contentRect.x + 5, _contentRect.y + 70, width, height); //GUI.Box(rect, "", ResourcesManager.GetInstance.skin.box); EditorGUI.LabelField(rect, con, style); }
protected void DuplicateNode(NodeModifier targetNode) { NodeModifier node = ReflectionHelper.CreateInstance <NodeModifier>(targetNode.GetType().FullName); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson(targetNode), node); node._position = new Vector2(node._position.x + 10, node._position.y + 10); if (targetNode.Parent != null) { NodeModifier.SetParent(node, targetNode.Parent); } else if (targetNode.Content != null) { NodeModifier.SetContent(node, targetNode.Content); } DragModifier d = node.GetContent() as DragModifier; node.SetID(d.GenerateID()); }