using UnityEditor;

[CustomEditor(typeof(RewardTier))]
public class RewardTierEditor : Editor
{
    public override void OnInspectorGUI()
    {
        this.DrawDefaultInspector();

        SerializedProperty upperReward = this.serializedObject.FindProperty("upperBattleReward");
        SerializedProperty lowerReward = this.serializedObject.FindProperty("lowerBattleReward");

        EditorGUI.BeginChangeCheck();

        var target = (RewardTier)this.target;

        if(target.upperBattleReward != null)
        {
            EditorGUILayout.PropertyField(lowerReward);
        }

        if(EditorGUI.EndChangeCheck())
        {
            this.serializedObject.ApplyModifiedProperties();
        }
    }

}
