0
Hallo Ich habe ein kleines Problem mit einer Funktion. Ich brauche HilfeEditor Editor EditorGUILayout.EnumPopup mit Generika
public static void BuildContentEnum<T>(string label, string toolTip, SerializedProperty property)
{
EditorGUILayout.BeginHorizontal();
property.enumValueIndex = (T)EditorGUILayout.EnumPopup(BuildContentBasic(label, toolTip), (T)Enum.GetValues(typeof(T)).GetValue(property.enumValueIndex));
EditorGUILayout.EndHorizontal();
}
Fehler CS1503: Argument #2' cannot convert
T
'EditorGUILayout.EnumPopup' gibt' Enum' so nicht mit einer generischen/Vorlage verwenden kann 'T', schätze ich. Verwenden Sie etwas wie folgt: http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum –