How would one go about switching from guns to hand to hand system?

My player can shoot, but ammo is scares and will have to use melee combat. I have the shooting system working and the melee system works…however, I’m not sure how to go about switching.

my thought is to have a combat controller that turns on and off the appropriate scripts in order for the animations and such controls to be correct.(not shooting while holding an axe) Is this the right path? I don’t want to spend hours making this stuff work to find out that it was not the right way to go. I try to figure code out on my own and keep hacking away until it works.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CombatController : MonoBehaviour
{
    [Header("Refrences")]
    private Weapon weapon;
    private HandCombat combat;
    private Animator animator;
    [Header("Runtime Animation")]
    public RuntimeAnimatorController humanoidController;
    public RuntimeAnimatorController meleeController;
    public RuntimeAnimatorController pistolController;
    [Header("CombatModes")]
    public Transform Axe;
    public Transform knife;
    public Transform pistol;

    
    public void Awake()
    {
        weapon = GetComponent<Weapon>();
        combat = GetComponent<HandCombat>();
        animator = GetComponent<Animator>();
        
    }
    // Start is called before the first frame update
    void Start()
    {
        FreeHandMode();
    }

    // Update is called once per frame
    void Update()
    {
        if(Input.GetKey(KeyCode.Alpha1))
        {
            FreeHandMode();
        }
        if(Input.GetKey(KeyCode.Alpha2))
        {
            MeleeMode();
        }
        if (Input.GetKey(KeyCode.Alpha3))
        {
            ShootMode();
        }
    }

    private void FreeHandMode()
    {
        animator.runtimeAnimatorController = humanoidController as RuntimeAnimatorController;
        gameObject.GetComponent<Weapon>().enabled = false;
        gameObject.GetComponent<HandCombat>().enabled = false;
        Axe.gameObject.SetActive(false);
        knife.gameObject.SetActive(false);
        pistol.gameObject.SetActive(false);

    }

    private void MeleeMode()
    {
        animator.runtimeAnimatorController = meleeController as RuntimeAnimatorController;
        gameObject.GetComponent<Weapon>().enabled = false;
        gameObject.GetComponent<HandCombat>().enabled = true;
        Axe.gameObject.SetActive(true);
        knife.gameObject.SetActive(false);
        pistol.gameObject.SetActive(false);
    }

    private void ShootMode()
    {
        animator.runtimeAnimatorController = pistolController as RuntimeAnimatorController;
        gameObject.GetComponent<Weapon>().enabled = true;
        gameObject.GetComponent<HandCombat>().enabled = false;
        Axe.gameObject.SetActive(false);
        knife.gameObject.SetActive(false);
        pistol.gameObject.SetActive(true);
    }
}