mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Fixed some coding conventions errors
This commit is contained in:
parent
76dcbb94c6
commit
0020bf87e3
@ -23,8 +23,8 @@ namespace XNodeEditor {
|
||||
[NonSerialized] private XNode.NodePort draggedOutputTarget = null;
|
||||
[NonSerialized] private List<Vector2> draggedOutputReroutes = new List<Vector2>();
|
||||
[NonSerialized] private XNode.NodeGraphComment hoveredComment = null;
|
||||
[NonSerialized] private bool deselectingComment = false;
|
||||
[NonSerialized] private XNode.NodeGraphComment resizingComment = null;
|
||||
private bool deselectingComment = false;
|
||||
public enum NodeGraphCommentSide { Top, TopRight, Right, BottomRight, Bottom, BottomLeft, Left, TopLeft }
|
||||
public static NodeGraphCommentSide resizingCommentSide;
|
||||
private RerouteReference hoveredReroute = new RerouteReference();
|
||||
@ -402,8 +402,7 @@ namespace XNodeEditor {
|
||||
XNode.Node node = Selection.objects[i] as XNode.Node;
|
||||
dragOffset[i] = node.position - WindowToGridPosition(current.mousePosition);
|
||||
}
|
||||
else if (Selection.objects[i] is XNode.NodeGraphComment)
|
||||
{
|
||||
else if (Selection.objects[i] is XNode.NodeGraphComment) {
|
||||
XNode.NodeGraphComment comment = Selection.objects[i] as XNode.NodeGraphComment;
|
||||
dragOffset[i] = comment.position - WindowToGridPosition(current.mousePosition);
|
||||
}
|
||||
@ -450,10 +449,8 @@ namespace XNodeEditor {
|
||||
}
|
||||
|
||||
/// <summary> Initiate a rename on the currently selected comment </summary>
|
||||
public void RenameSelectedComment()
|
||||
{
|
||||
if (Selection.objects.Length == 1 && Selection.activeObject is XNode.NodeGraphComment)
|
||||
{
|
||||
public void RenameSelectedComment() {
|
||||
if (Selection.objects.Length == 1 && Selection.activeObject is XNode.NodeGraphComment) {
|
||||
renamingComment = Selection.activeObject as XNode.NodeGraphComment;
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,8 +26,7 @@ namespace XNodeEditor {
|
||||
|
||||
Controls();
|
||||
|
||||
if (e.type == EventType.Layout)
|
||||
{
|
||||
if (e.type == EventType.Layout) {
|
||||
selectionCache = new List<UnityEngine.Object>(Selection.objects);
|
||||
}
|
||||
|
||||
@ -500,8 +499,7 @@ namespace XNodeEditor {
|
||||
renamingComment = null;
|
||||
renamingStarted = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Selection changed, so stop renaming.
|
||||
GUILayout.Label(comment.comment, NodeEditorResources.styles.commentHeader, GUILayout.Height(26));
|
||||
renamingComment = null;
|
||||
@ -587,7 +585,6 @@ namespace XNodeEditor {
|
||||
if (!resizeAreaClicked) hoveredComment = comment;
|
||||
}
|
||||
}
|
||||
|
||||
//If dragging a selection box, add nodes inside to selection
|
||||
if (currentActivity == NodeActivity.DragGrid) {
|
||||
if (windowRect.Overlaps(selectionBox)) preSelection.Add(comment);
|
||||
|
||||
@ -161,7 +161,6 @@ namespace XNodeEditor {
|
||||
for (int i = 0; i < graph.nodes.Count; i++) {
|
||||
XNode.Node node = graph.nodes[i];
|
||||
if (!node) continue;
|
||||
|
||||
if (commentRect.Contains(node.position)) SelectNode(node, true);
|
||||
}
|
||||
}
|
||||
@ -169,8 +168,6 @@ namespace XNodeEditor {
|
||||
public void DeselectNodesInComment(XNode.NodeGraphComment comment)
|
||||
{
|
||||
List<Object> selection = new List<Object>(Selection.objects);
|
||||
|
||||
|
||||
Rect commentRect = new Rect(comment.position, comment.size);
|
||||
for (int i = 0; i < graph.nodes.Count; i++) {
|
||||
XNode.Node node = graph.nodes[i];
|
||||
|
||||
@ -61,7 +61,6 @@ namespace XNode {
|
||||
NodeGraphComment comment = ScriptableObject.CreateInstance<NodeGraphComment>();
|
||||
comment.graph = this;
|
||||
comments.Add(comment);
|
||||
|
||||
return comment;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user