You can achieve this with some conditional data flow in a custom inspector.
I found these links online, be careful tho.
I believe that using this method you have to manually add all variables you want to edit in the editor to show in the editor
Unity Discussions:
https://discussions.unity.com/t/what-is-the-efficient-way-of-showing-variables-depend-on-enum-in-custom-inspector/231909/3
Unity Manual:
https://docs.unity3d.com/Manual/editor-CustomEditors.html