[SOLVED] Disable / enable specific input button - call C# variable from js

EDIT 2: Problem solved. There’s an adage called “Occam’s razor,” which essentially says “the simplest solution is the best one.” So, since js is what I’m comfortable with, I simply reverse engineered my two C# scripts to it, then declared a variable. Once I did that, everything ran smoothly.

[Edit] Thanks to Meltdown and thaiscorpion there’s been quite a bit of progress made on this since last night, but I’m asking for a bit more help to get over the hump. Long story short, pressing the “pause” button on a gamepad brings up the pause menu, naturally. When in a shop, however, I need to disable that. Have gotten done with that part, using a variable, but once out of the shop I need to reenable the pause button, and that’s where I’m having issues. (actually, to be fair, the way I have the script(s) written up right now might be preventing it from working at all) There are three scripts involved: The pause script, which is simply a camera switch, the shop script, which is also a camera switch, and the shop inventory. The issue is the camera switches are both in C# (I know, I know) while the shop inventory is in js. I believe that I’m calling the variable correctly, which resides in C#, from the js script, and I have the scripts in the correct folders for compiling order, but think my syntax might be wrong, or something else that’s preventing the variable from being set to false. Am hoping fresh eyes might spot what I’m doing wrong. Thanks, and God bless.

Script 1: Shop script

using UnityEngine;
using System.Collections;

public class Shopcam : MonoBehaviour {

	public static bool _inShop = false; // <------- THIS VARIABLE
	public Camera camera1;
     
    public Camera camera2;
     
    bool camera1ActiveBool;
     
     
    void Start () {
     
    camera1.camera.active = true;
     
    camera2.camera.active = false;
     
    camera1ActiveBool = true;
		
    }
     
     
    void OnTriggerEnter(Collider col) {
     
    //use whatever button you want to toggle
	_inShop = true;
          if(col.gameObject.tag == "Player") {
              if (camera1ActiveBool == true)
          {
                   camera1.camera.active = false;
                   camera2.camera.active = true;
     
                  camera1ActiveBool = false;
	              Time.timeScale = 0;			
			}
    }
	}

}

Second Script

using UnityEngine;
using System.Collections;

public class Menu : MonoBehaviour {

     public Camera camera1;
 
public Camera camera2;
 
bool camera1ActiveBool;
 
 
void Start () {
 
camera1.camera.active = true;
 
camera2.camera.active = false;
 
camera1ActiveBool = true;
	
}
 
 
void Update () {
 
//use whatever button you want to toggle
if (Shopcam._inShop = false){	
if(Input.GetButtonDown("Inventory")){
 
if (camera1ActiveBool == true)
{
camera1.camera.active = false;
camera2.camera.active = true;
 
camera1ActiveBool = false;
			
 Time.timeScale = 0;
}
 
else if (camera1ActiveBool == false)
{
camera1.camera.active = true;
camera2.camera.active = false;
 
camera1ActiveBool = true;
			 Time.timeScale = 1;
}
		}
}
}
}

Third Script Fragments (entire thing is TL:DR, and mostly irrelevant, I believe. This just includes the variable call

//in js
var csScript : Shopcam;
var SwitchCamera : GameObject;

function Start (){
csScript = SwitchCamera.GetComponent("Shopcam");
}

function SelectItemFromInventory()
{
	if(itemPosition == 4)
		{
			
       csScript._inShop = true; // here's where I'm trying to change the variable in the C# script
}

[END OF EDIT]

Hello again, friends!
I tried looking this up, and saw a couple of topics that were similar but not quite the same as I want to do. Essentially, I want to disable one gamepad button upon activation of a script. For instance: The player goes into a shop, and the “shop” script opens. In reality, the shop script is little more than my inventory script, which is attached to button “pause.” (as I have it assigned in the input manager) So while the player is in the “shop” I’d like to disable the pause button, but no others, as they still need to navigate their selections and choose their purchases with another button. Does anyone know if this can be done? Thanks, and God bless.

Use a boolean variable and disable the pause button if they’re in the shop?

bool _inShop = false;

void Update()
{
  // Code to set user as being in shop
  _inShop = true;

  // Code to handle input
  if(Input.GetKey("Pause")
  {
     PauseGame();
  }
}

void PauseGame()
{
  if(_inShop)
    return;

  // Else do code here to pause game...

}