1- using GBG . PlayableGraphMonitor . Editor . Node ;
2- using System ;
1+ using System ;
32using System . Collections . Generic ;
3+ using GBG . PlayableGraphMonitor . Editor . Node ;
44using UnityEditor ;
55using UnityEngine ;
66using UnityEngine . Animations ;
7+ using UnityEngine . Audio ;
78using UnityEngine . Playables ;
89using UnityEngine . UIElements ;
910using URandom = UnityEngine . Random ;
@@ -65,26 +66,27 @@ public static Color GetPortColor(float weight)
6566 #endregion
6667
6768
68-
6969 public static Color GetButtonBackgroundColor ( bool isChecked )
7070 {
7171 if ( isChecked )
7272 {
73- return EditorGUIUtility . isProSkin ?
74- new Color32 ( 70 , 96 , 124 , 255 ) : // dark
73+ return EditorGUIUtility . isProSkin
74+ ? new Color32 ( 70 , 96 , 124 , 255 )
75+ : // dark
7576 new Color32 ( 150 , 195 , 251 , 255 ) ; // light
76-
7777 }
7878
79- return EditorGUIUtility . isProSkin ?
80- new Color32 ( 88 , 88 , 88 , 255 ) : // dark
79+ return EditorGUIUtility . isProSkin
80+ ? new Color32 ( 88 , 88 , 88 , 255 )
81+ : // dark
8182 new Color32 ( 228 , 228 , 228 , 255 ) ; // light
8283 }
8384
8485 public static Color GetNodeInspectorBackgroundColor ( )
8586 {
86- return EditorGUIUtility . isProSkin ?
87- new Color32 ( 50 , 50 , 50 , 255 ) : // dark
87+ return EditorGUIUtility . isProSkin
88+ ? new Color32 ( 50 , 50 , 50 , 255 )
89+ : // dark
8890 new Color32 ( 175 , 175 , 175 , 255 ) ; // light
8991 }
9092
@@ -93,8 +95,9 @@ public static Color GetNodeInspectorBackgroundColor()
9395
9496 public static Color GetNodeInspectorTextColor ( )
9597 {
96- return EditorGUIUtility . isProSkin ?
97- new Color32 ( 255 , 255 , 255 , 255 ) : // dark
98+ return EditorGUIUtility . isProSkin
99+ ? new Color32 ( 255 , 255 , 255 , 255 )
100+ : // dark
98101 new Color32 ( 0 , 0 , 0 , 255 ) ; // light
99102 }
100103
@@ -108,14 +111,18 @@ public static Color GetPlayableOutputNodeColor(this ref PlayableOutput playableO
108111 {
109112 if ( playableOutput . IsPlayableOutputOfType < AnimationPlayableOutput > ( ) )
110113 {
111- return new Color32 ( 0 , 255 , 255 , 255 ) ;
114+ return new Color32 ( 0 , 240 , 255 , 255 ) ;
112115 }
113116
114- if ( playableOutput . IsPlayableOutputOfType < ScriptPlayableOutput > ( ) )
117+ if ( playableOutput . IsPlayableOutputOfType < AudioPlayableOutput > ( ) )
115118 {
116- return new Color32 ( 0 , 204 , 255 , 255 ) ;
119+ return new Color32 ( 0 , 190 , 255 , 255 ) ;
117120 }
118121
122+ if ( playableOutput . IsPlayableOutputOfType < ScriptPlayableOutput > ( ) )
123+ {
124+ return new Color32 ( 0 , 140 , 255 , 255 ) ;
125+ }
119126
120127 return GetRandomColorForType ( playableOutput . GetPlayableOutputType ( ) ) ;
121128 }
@@ -125,22 +132,39 @@ public static Color GetPlayableNodeColor(this ref Playable playable)
125132 {
126133 if ( playable . IsPlayableOfType < AnimationClipPlayable > ( ) )
127134 {
128- return new Color32 ( 0 , 255 , 51 , 255 ) ;
135+ return new Color32 ( 0 , 255 , 25 , 255 ) ;
136+ }
137+
138+ // Audio
139+ if ( playable . IsPlayableOfType < AudioClipPlayable > ( ) )
140+ {
141+ return new Color32 ( 0 , 255 , 60 , 255 ) ;
129142 }
130143
131144 if ( playable . IsPlayableOfType < AnimationMixerPlayable > ( ) )
132145 {
133- return new Color32 ( 0 , 255 , 102 , 255 ) ;
146+ return new Color32 ( 0 , 255 , 95 , 255 ) ;
147+ }
148+
149+ // Audio
150+ if ( playable . IsPlayableOfType < AudioMixerPlayable > ( ) )
151+ {
152+ return new Color32 ( 0 , 255 , 130 , 255 ) ;
134153 }
135154
136155 if ( playable . IsPlayableOfType < AnimationLayerMixerPlayable > ( ) )
137156 {
138- return new Color32 ( 0 , 255 , 153 , 255 ) ;
157+ return new Color32 ( 0 , 255 , 165 , 255 ) ;
139158 }
140159
141160 if ( playable . IsPlayableOfType < AnimationScriptPlayable > ( ) )
142161 {
143- return new Color32 ( 0 , 255 , 204 , 255 ) ;
162+ return new Color32 ( 0 , 255 , 200 , 255 ) ;
163+ }
164+
165+ if ( playable . IsPlayableOfType < AnimatorControllerPlayable > ( ) )
166+ {
167+ return new Color32 ( 0 , 255 , 235 , 255 ) ;
144168 }
145169
146170 return GetRandomColorForType ( playable . GetPlayableType ( ) ) ;
@@ -153,13 +177,13 @@ public static Color GetPlayableNodeColor(this ref Playable playable)
153177 // reserve (0, 255, ?, 255) for Playable nodes
154178 public static readonly IReadOnlyList < Color32 > ColorPool = new Color32 [ ]
155179 {
156- new Color32 ( 255 , 0 , 255 , 255 ) , new Color32 ( 255 , 0 , 153 , 255 ) ,
157- new Color32 ( 153 , 255 , 0 , 255 ) , new Color32 ( 204 , 255 , 0 , 255 ) ,
158- new Color32 ( 255 , 255 , 0 , 255 ) , new Color32 ( 255 , 204 , 0 , 255 ) ,
159- new Color32 ( 255 , 153 , 0 , 255 ) , new Color32 ( 255 , 102 , 0 , 255 ) ,
160- new Color32 ( 153 , 204 , 255 , 255 ) , new Color32 ( 153 , 255 , 102 , 255 ) ,
161- new Color32 ( 153 , 255 , 153 , 255 ) , new Color32 ( 153 , 255 , 204 , 255 ) ,
162- new Color32 ( 204 , 255 , 102 , 255 ) , new Color32 ( 204 , 255 , 255 , 255 ) ,
180+ new Color32 ( 255 , 0 , 255 , 255 ) , new Color32 ( 255 , 0 , 153 , 255 ) ,
181+ new Color32 ( 153 , 255 , 0 , 255 ) , new Color32 ( 204 , 255 , 0 , 255 ) ,
182+ new Color32 ( 255 , 255 , 0 , 255 ) , new Color32 ( 255 , 204 , 0 , 255 ) ,
183+ new Color32 ( 255 , 153 , 0 , 255 ) , new Color32 ( 255 , 102 , 0 , 255 ) ,
184+ new Color32 ( 153 , 204 , 255 , 255 ) , new Color32 ( 153 , 255 , 102 , 255 ) ,
185+ new Color32 ( 153 , 255 , 153 , 255 ) , new Color32 ( 153 , 255 , 204 , 255 ) ,
186+ new Color32 ( 204 , 255 , 102 , 255 ) , new Color32 ( 204 , 255 , 255 , 255 ) ,
163187 } ;
164188
165189 private static readonly Dictionary < Type , Color32 > _colorCache = new Dictionary < Type , Color32 > ( ) ;
@@ -183,4 +207,4 @@ public static void ClearGlobalCache()
183207 _colorCache . Clear ( ) ;
184208 }
185209 }
186- }
210+ }
0 commit comments