public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { float origLabelWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 85; GUILayout.BeginHorizontal(); //Draw image SerializedProperty imageProp = property.FindPropertyRelative("m_icon"); imageProp.objectReferenceValue = EditorGUILayout.ObjectField(imageProp.objectReferenceValue, typeof(Texture2D), false, GUILayout.Height(100), GUILayout.Width(100)); GUILayout.BeginVertical(); //Draw name and ID DataElementHelper.OnGUI_DrawDefaultValues(property); /// This special method draws the element and it'd ID in a nicely formatted line. //Draw rarity and sell price GUILayout.Space(4); GUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(property.FindPropertyRelative("m_weaponType")); EditorGUILayout.PropertyField(property.FindPropertyRelative("m_rarity")); EditorGUILayout.PropertyField(property.FindPropertyRelative("m_sellPrice")); GUILayout.EndHorizontal(); //Draw stats GUILayout.Space(4); GUILayout.BeginHorizontal(); StatDrawer(property.FindPropertyRelative("m_atk")); StatDrawer(property.FindPropertyRelative("m_def")); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); StatDrawer(property.FindPropertyRelative("m_spd")); StatDrawer(property.FindPropertyRelative("m_crit")); GUILayout.EndHorizontal(); //Draw Prefab GUILayout.Space(2); EditorGUILayout.PropertyField(property.FindPropertyRelative("m_prefab")); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(4); EditorGUIUtility.labelWidth = origLabelWidth; }