how to disable enum if bool is not true in inspector unity

I want to enable an enum when a bool value is true through the inspector and disable it when the value is false. Please see the relevant code below:

public bool hasWeapon;

[System.Serializable]
public enum WeaponType {HandGun, Sword, ShotGun, Spear, BowAndArrow};

public WeaponType weaponType;

From the above code weaponType should only appear in the inspector if hasWeapon is true.

How can this be done?

You have to use editor scripts