public override void OnInspectorGUI() { ItemScript selected = target as ItemScript; bool save = false; save |= SerializedStringProperty("name", "Name"); save |= SerializedIntProperty("value", "Abstract Value", true); save |= SerializedEquipmentType("Equipment Type"); if (selected.IsWeapon) { save |= DrawPropertiesOfWeapon(); } if (selected.IsUsable) { save |= DrawPropertiesOfUsable(selected); } if (selected.IsConsumable) { save |= DrawPropertiesOfEdible(); } if (save) { serializedObject.ApplyModifiedProperties(); } EditorGUILayout.LabelField("Monetary value", selected.MonetaryValueInCoin()); }