コード例 #1
0
 /// <summary>
 /// Set the knob position at the specified side, from Top->Bottom and Left->Right
 /// </summary>
 public void SetPosition(float position, NodeSide nodeSide)
 {
     if (side != nodeSide)
     {
         int cur = (int)side, next = (int)nodeSide;
         if (next < cur)
         {
             next += 4;
         }
         while (cur < next)
         {
             knobTexture = NodeEditorGUI.RotateTexture90Degrees(knobTexture);
             cur++;
         }
     }
     side = nodeSide;
     SetPosition(position);
 }
コード例 #2
0
 public void CheckTexture()
 {
     if (knobTexture == null)
     {
         knobTexture = ConnectionTypes.GetTypeData(type).InputKnob;
         if (knobTexture == null)
         {
             throw new UnityException("Connection type " + type + " has no knob texture assigned!");
         }
         if (side != NodeSide.Left)
         {
             int cur = (int)NodeSide.Left, next = (int)side;
             if (next < cur)
             {
                 next += 4;
             }
             while (cur < next)
             {
                 knobTexture = NodeEditorGUI.RotateTexture90Degrees(knobTexture);
                 cur++;
             }
         }
     }
 }