private void DrawPageJoints(Node node, Vector2 mousePosition) { foreach (NodeJoint j in node.joints) { j.ownerID = node.Index; j.ownerNode = node; if (j.IsConnected()) { if (j.IsOutput) { NodeJoint jnt = null; if (j.connectionPoint.ownerNode != null) { jnt = j.connectionPoint.ownerNode.joints[j.connectionPoint.JointIndex]; } else { jnt = VisualNovelEditor.FindJoint(j.connectionPoint.OwnerID, j.connectionPoint.JointIndex); } if (jnt != null) { CalculateAndDrawBezier(j.bounds.center, jnt.bounds.center, j.info, jnt.info); } } GUI.Label(new Rect(new Vector2(j.bounds.position.x + j.bounds.width + 10f, j.bounds.position.y), new Vector2(50, 50)), j.connectionPoint.OwnerID + " " + (j.IsOutput ? "OUT" : "IN"), EditorGUILayoutExtensions.ChangeTextColor(_styles[StyledElement.Label], Color.white)); } } EditorGUI.DrawRect(node.TopJoint.bounds, node.Outputting && !node.TopJoint.IsConnected() ? Color.magenta : node.TopJoint.CheckForHover(mousePosition) ? Color.yellow : Color.red); EditorGUI.DrawRect(node.BottomJoint.bounds, node.Outputting && !node.BottomJoint.IsConnected() ? Color.magenta : node.BottomJoint.CheckForHover(mousePosition) ? Color.yellow : Color.red); EditorGUI.DrawRect(node.LeftJoint.bounds, node.Outputting && !node.LeftJoint.IsConnected() ? Color.magenta : node.LeftJoint.CheckForHover(mousePosition) ? Color.yellow : Color.red); EditorGUI.DrawRect(node.RightJoint.bounds, node.Outputting && !node.RightJoint.IsConnected() ? Color.magenta : node.RightJoint.CheckForHover(mousePosition) ? Color.yellow : Color.red); }
private void DrawStateJoints(Node node, Vector2 mousePosition) { if (node.isStartNode) { node.BottomJoint.ownerID = node.Index; node.BottomJoint.ownerNode = node; EditorGUI.DrawRect(node.BottomJoint.bounds, node.BottomJoint.CheckForHover(mousePosition) ? Color.green : Color.blue); if (node.BottomJoint.IsConnected()) { if (node.BottomJoint.IsOutput) { NodeJoint jnt = null; if (node.BottomJoint.connectionPoint.ownerNode != null) { jnt = node.BottomJoint.connectionPoint.ownerNode.joints[node.BottomJoint.connectionPoint.JointIndex]; } else { jnt = VisualNovelEditor.FindJoint(node.BottomJoint.connectionPoint.OwnerID, node.BottomJoint.connectionPoint.JointIndex); } if (jnt != null) { CalculateAndDrawBezier(node.BottomJoint.bounds.center, jnt.bounds.center, node.BottomJoint.info, jnt.info); } } } } else //End Node { node.TopJoint.ownerID = node.Index; node.TopJoint.ownerNode = node; EditorGUI.DrawRect(node.TopJoint.bounds, node.TopJoint.CheckForHover(mousePosition) ? Color.cyan : Color.grey); if (node.TopJoint.IsConnected()) { if (node.TopJoint.IsOutput) { NodeJoint jnt = null; if (node.TopJoint.connectionPoint.ownerNode != null) { jnt = node.TopJoint.connectionPoint.ownerNode.joints[node.TopJoint.connectionPoint.JointIndex]; } else { jnt = VisualNovelEditor.FindJoint(node.TopJoint.connectionPoint.OwnerID, node.TopJoint.connectionPoint.JointIndex); } if (jnt != null) { CalculateAndDrawBezier(node.TopJoint.bounds.center, jnt.bounds.center, node.TopJoint.info, jnt.info); } } } } }