Beispiel #1
0
        //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;
            }
        }
Beispiel #2
0
            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));
                    }
                }
            }
Beispiel #3
0
        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());
        }
Beispiel #4
0
 public static Color GetSelectorCellColor(PWColorSchemeName csn)
 {
     return(colorSchemes[csn].selectorCellColor);
 }
Beispiel #5
0
 public static Color GetNodeColor(PWColorSchemeName csn)
 {
     return(colorSchemes[csn].nodeColor);
 }
Beispiel #6
0
 public static Color GetAnchorColor(PWColorSchemeName csn)
 {
     return(colorSchemes[csn].anchorColor);
 }
Beispiel #7
0
 public static Color GetLinkColor(PWColorSchemeName csn)
 {
     return(colorSchemes[csn].linkColor);
 }
Beispiel #8
0
    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);
    }