Beispiel #1
0
        protected internal virtual void Draw()
        {
#if UNITY_EDITOR
            if (NodeSkin == null)
            {
                return;
            }
            CheckKnobMigration();
            nodeRect = rect;
            EffectUtility.RectConverting(ref nodeRect, curGraph.curNodeState);
            Vector2 contentOffset = new Vector2(0, 15 * curGraph.curNodeState.GraphZoom);
            Rect    nodeHead      = new Rect(0, 0, nodeRect.width, contentOffset.y);
            Rect    nodeBody      = new Rect(nodeRect.x, nodeRect.y, nodeRect.width,
                                             nodeRect.height);
            using (var group = new ClipGroup(nodeBody))
            {
                nodeBody.position = Vector2.zero;
                using (var area = new ClipArea(nodeBody, NodeSkin.GetStyle("nodeBody")))
                {
                    var style = NodeSkin.GetStyle("nodeHead");
                    style.fontSize = (int)(10 * curGraph.curNodeState.GraphZoom);
                    GUI.Label(nodeHead, Title, style);
                    GUILayout.Space(contentOffset.y);
                    NodeGUI();
                }
            }
            //GUILayout.BeginArea(nodeBody, curGraph.curNodeState.SelectedNode == this
            //    ? NodeSkin.GetStyle("nodeBodySelected")
            //    : NodeSkin.GetStyle("nodeBody"));

            // GUILayout.EndArea();
            DrawKnob();
            DrawConnections();
#endif
        }
Beispiel #2
0
        public virtual void Draw(Node bodyNode)
        {
#if UNITY_EDITOR
            Body = bodyNode;
            rect = GetGUIKnob();
            EffectUtility.RectConverting(ref rect, Body.curGraph.curNodeState);
            if (texture2D == null)
            {
                CheckColor();
                return;
            }
            DrawCotName();
            //GUI.DrawTexture(rect, texture2D);
            GUI.DrawTextureWithTexCoords(rect, texture2D, new Rect(0, 0, 1, 1));
#endif
        }