NodeOutput.GetKnob C# (CSharp) Méthode

GetKnob() public méthode

Get the rect of the knob left to the input
public GetKnob ( ) : Rect
Résultat Rect
    public Rect GetKnob()
    {
        int knobSize = Node_Editor.editor.knobSize;
        return new Rect (rect.x - knobSize,
                         rect.y + (rect.height - knobSize) / 2,
                         knobSize, knobSize);
    }

Usage Example

Exemple #1
0
    /// <summary>
    /// Draws the node curves as well as the knobs
    /// </summary>
    public void DrawConnectors()
    {
        for (int outCnt = 0; outCnt < Outputs.Count; outCnt++)
        {
            NodeOutput output = Outputs [outCnt];

            for (int conCnt = 0; conCnt < output.connections.Count; conCnt++)
            {
                if (output.connections [conCnt] != null)
                {
                    Node_Editor.DrawNodeCurve(output.GetKnob().center,
                                              output.connections [conCnt].GetKnob().center);
                }
                else
                {
                    output.connections.RemoveAt(conCnt);
                }
            }

            GUI.DrawTexture(output.GetKnob(), Node_Editor.ConnectorKnob);
        }

        for (int inCnt = 0; inCnt < Inputs.Count; inCnt++)
        {
            GUI.DrawTexture(Inputs [inCnt].GetKnob(), Node_Editor.ConnectorKnob);
        }
    }
All Usage Examples Of NodeOutput::GetKnob