How to make a scope cam that's optional

Greetings everyone,
I am completely new to Unity (or just coding in general) and am trying to make a mecha game.

One part of this mecha game is that I’m trying to build a system where it’s possible to switch between 3 points of view:

  1. Standard 3rd person mode,
  2. Standard 1st person mode, and
  3. Aim Down Sight mode, only when the weapon is equipped with a scope.

The problem regarding to this is that, with some googlefu I can figure out a general idea of how to switch between modes (very likely not correct as depicted below);

public GameObject ThirdCam;
public GameObject FirstCam;
public GameObject ScopeCam;
public int CamMode;

void Update() {
if(Input.GetButtonDown("Camera"))
if(CamMode==2){CamMode = 0;}else{CamMode+-=1;}
if(CamMode>2 and CamMode<0){CamMode=0)}
}

IEnumerator CamChange(){
yield return new WaitForSeconds(0.01f);
if (CamMode==0){
ThirdCam.SetActive(true);
FirstCam.SetActive(false);
ScopeCam.SetActive(false);
if (CamMode==1)
ThirdCam.SetActive(false);
FirstCam.SetActive(true);
ScopeCam.SetActive(false);
if (CamMode==2)
ThirdCam.SetActive(false);
FirstCam.SetActive(false);
ScopeCam.SetActive(true);
}

But if I want to ensure ScopeCam is possible only if the player has a weapon that is equipped with ScopeCam, how do I detect whenever ScopeCam is equipped and allow ScopeCam view to be true, and vice versa?

Camera stuff is pretty tricky… you may wish to consider using Cinemachine from the Unity Package Manager.

There’s even a dedicated forum: Unity Engine - Unity Discussions

Otherwise if you insist on rolling all this camera code yourself, start with some good tutorials on it. It’s insanely complex and could never be adequately described in a little text box here.

If the weapon is not equipped and if CamMode > 2 then CamMode can = 0.

In code-wise, how do I check if Weapon is equipped with ScopeCam?

I probably should learn cinemachine instead i think, thanks