//this function will be called twiced, from the two linked anchors // and so will receive two different anchor in parameter public void OnAfterDeserialize(PWAnchor anchor) { if (anchor.anchorType == PWAnchorType.Output) { fromAnchor = anchor; } else { toAnchor = anchor; } if (fromAnchor != null) { fromNode = fromAnchor.nodeRef; } if (toAnchor != null) { toNode = toAnchor.nodeRef; } //update link color: if (fromAnchor != null) { colorSchemeName = fromAnchor.colorSchemeName; } }
public PWNodeTypeInfoList(int allowedGraphMask, string title, PWColorSchemeName colorSchemeName, params object[] nodeTypeInfos) { this.allowedGraphMask = allowedGraphMask; this.title = title; this.colorSchemeName = colorSchemeName; if (nodeTypeInfos != null) { for (int i = 0; i < nodeTypeInfos.Length - 1; i += 2) { typeInfos.Add(new PWNodeTypeInfo(nodeTypeInfos[i] as string, nodeTypeInfos[i + 1] as Type)); } } }
Rect DrawSelectorCase(string name, PWColorSchemeName colorSchemeName, bool title = false) { if (title) { GUI.color = PWColorTheme.GetSelectorHeaderColor(colorSchemeName); GUILayout.Label(name, nodeSelectorTitleStyle); GUI.color = Color.white; } else { GUILayout.Label(name, nodeSelectorCaseStyle); } return(GUILayoutUtility.GetLastRect()); }
public static Color GetSelectorCellColor(PWColorSchemeName csn) { return(colorSchemes[csn].selectorCellColor); }
public static Color GetNodeColor(PWColorSchemeName csn) { return(colorSchemes[csn].nodeColor); }
public static Color GetAnchorColor(PWColorSchemeName csn) { return(colorSchemes[csn].anchorColor); }
public static Color GetLinkColor(PWColorSchemeName csn) { return(colorSchemes[csn].linkColor); }
void DrawSelectedBezier(Vector3 startPos, Vector3 endPos, Vector3 startTan, Vector3 endTan, PWColorSchemeName colorSchemeName, int width, PWLinkHighlight highlight) { switch (highlight) { case PWLinkHighlight.Selected: Handles.DrawBezier(startPos, endPos, startTan, endTan, PWColorTheme.selectedColor, null, width + 3); break; case PWLinkHighlight.Delete: case PWLinkHighlight.DeleteAndReset: Handles.DrawBezier(startPos, endPos, startTan, endTan, PWColorTheme.deletedColor, null, width + 2); break; } Color c = PWColorTheme.GetLinkColor(colorSchemeName); Handles.DrawBezier(startPos, endPos, startTan, endTan, c, null, width); }