File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -116,12 +116,22 @@ private void DrawFieldContent(int controlID)
116116 {
117117 int indexOfComma = _serializedTypeRef . TypeNameAndAssembly . IndexOf ( ',' ) ;
118118 string fullTypeName = indexOfComma == - 1 ? string . Empty : _serializedTypeRef . TypeNameAndAssembly . Substring ( 0 , indexOfComma ) ;
119- GUIContent fieldContent = GUIContentHelper . Temp ( GetTypeToShow ( fullTypeName ) ) ;
119+ GUIContent fieldContent = GUIContentHelper . Temp ( GetTypeToShow ( fullTypeName , out bool typeExists ) ) ;
120+
121+ var previousColor = GUI . backgroundColor ;
122+
123+ if ( ! typeExists )
124+ GUI . backgroundColor = new Color ( 1f , 0f , 0f , .5f ) ;
125+
120126 EditorStyles . popup . Draw ( _position , fieldContent , controlID ) ;
127+
128+ GUI . backgroundColor = previousColor ;
121129 }
122130
123- private string GetTypeToShow ( string typeName )
131+ private string GetTypeToShow ( string typeName , out bool typeExists )
124132 {
133+ typeExists = true ;
134+
125135 if ( ProjectSettings . UseBuiltInNames )
126136 {
127137 string builtInName = typeName . ReplaceWithBuiltInName ( ) ;
@@ -136,7 +146,10 @@ private string GetTypeToShow(string typeName)
136146 return DropdownWindow . NoneElementName ;
137147
138148 if ( TypeCache . GetType ( _serializedTypeRef . TypeNameAndAssembly ) == null )
149+ {
150+ typeExists = false ;
139151 return typeName + MissingSuffix ;
152+ }
140153
141154 return typeName ;
142155 }
You can’t perform that action at this time.
0 commit comments