예제 #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
        /// <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())
                {                 // Generate consistent color for a type - using string because it delivers greater variety of colors than type hashcode
#if UNITY_5_4_OR_NEWER
                    UnityEngine.Random.InitState(styleID.GetHashCode());
#endif
                    color = UnityEngine.Random.ColorHSV(0, 1, 0.6f, 0.8f, 0.8f, 1.4f);
                }
                else
                {
                    color = _connectionStyle.Color;
                }
            }
        }