コード例 #1
0
 /// <summary>
 /// Checks and fetches the connection style declaration specified by the styleID
 /// </summary>
 protected void CheckConnectionStyle()
 {
     if (_connectionStyle == null || !_connectionStyle.isValid())
     {
         _connectionStyle = ConnectionPortStyles.GetPortStyle(styleID, styleBaseClass);
         if (_connectionStyle == null || !_connectionStyle.isValid())
         {
             color = NodeEditorGUI.RandomColorHSV(styleID.GetHashCode(), 0, 1, 0.6f, 0.8f, 0.8f, 1.4f);
         }
         else
         {
             color = _connectionStyle.Color;
         }
     }
 }
コード例 #2
0
 public void GenerateColor()
 {         // Generate consistent color for a type - using string because it delivers greater variety of colors than type hashcode
     color = NodeEditorGUI.RandomColorHSV(Identifier.GetHashCode(), 0, 1, 0.6f, 0.8f, 0.8f, 1.4f);
 }