File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Assets/com.alelievr.NodeGraphProcessor Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,12 @@ void InitializeView()
155
155
mainContainer . Add ( debugContainer ) ;
156
156
157
157
title = ( string . IsNullOrEmpty ( nodeTarget . name ) ) ? nodeTarget . GetType ( ) . Name : nodeTarget . name ;
158
-
159
- initializing = true ;
158
+
159
+ initializing = true ;
160
160
161
161
SetPosition ( nodeTarget . position ) ;
162
-
162
+ SetNodeColor ( nodeTarget . color ) ;
163
+
163
164
AddInputContainer ( ) ;
164
165
}
165
166
@@ -632,6 +633,12 @@ protected virtual void DrawDefaultInspector(bool fromInspector = false)
632
633
}
633
634
}
634
635
636
+ protected virtual void SetNodeColor ( Color color )
637
+ {
638
+ titleContainer . style . borderBottomColor = new StyleColor ( color ) ;
639
+ titleContainer . style . borderBottomWidth = new StyleFloat ( color . a > 0 ? 5f : 0f ) ;
640
+ }
641
+
635
642
private void AddEmptyField ( FieldInfo field , bool fromInspector )
636
643
{
637
644
if ( field . GetCustomAttribute ( typeof ( InputAttribute ) ) == null || fromInspector ) return ;
Original file line number Diff line number Diff line change @@ -19,7 +19,12 @@ public abstract class BaseNode
19
19
/// </summary>
20
20
/// <returns></returns>
21
21
public virtual string name => GetType ( ) . Name ;
22
-
22
+
23
+ /// <summary>
24
+ /// The accent color of the node
25
+ /// </summary>
26
+ public virtual Color color => Color . clear ;
27
+
23
28
/// <summary>
24
29
/// Set a custom uss file for the node. We use a Resources.Load to get the stylesheet so be sure to put the correct resources path
25
30
/// https://docs.unity3d.com/ScriptReference/Resources.Load.html
You can’t perform that action at this time.
0 commit comments