!!!!!!!!!!!!!скрипт PickAxe этот скрипт на игрока!!!!!!!!!!!!!!!!! using System.Collections; using System.Collections.Generic; using UnityEngine; public class PickAxe : MonoBehaviour { public GameObject Axe; public GameObject AxeFloor; public GameObject AxePanel; public GameObject lum; public GameObject ErrorPanel; private int g = 0; void OnTriggerStay(Collider col) { if (col.tag == "Axe") { AxePanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { if(lum.activeInHierarchy == false) { Axe.SetActive(true); AxeFloor.SetActive(false); AxePanel.SetActive(false); } else { } } if (lum.activeInHierarchy == true) { g += 1; } } } private void OnTriggerExit(Collider other) { AxePanel.SetActive(false); g = 0; } private void Update() { if (g == 1) { ErrorPanel.SetActive(true); } if (g == 0) { ErrorPanel.SetActive(false); } } } !!!!!!!!!!!!!!!!!скрипт PickLight этот скрипт на игрока!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! using System.Collections; using System.Collections.Generic; using UnityEngine; public class PickLight: MonoBehaviour { public GameObject Lum; public GameObject LumFloor; public GameObject LumPanel; public GameObject axe; public GameObject ErrorPanel; private int g = 0; void OnTriggerStay(Collider col) { if (col.tag == "Lum") { LumPanel.SetActive(true); if (Input.GetKeyDown(KeyCode.E)) { if (axe.activeInHierarchy == false) { Lum.SetActive(true); LumFloor.SetActive(false); LumPanel.SetActive(false); } else { } } if (axe.activeInHierarchy == true) { g += 1; } } } private void OnTriggerExit(Collider other) { LumPanel.SetActive(false); g = 0; } private void Update() { if (g == 1) { ErrorPanel.SetActive(true); } if (g == 0) { ErrorPanel.SetActive(false); } } } !!!!!!!!!!!!!!!!!скрипт LightSetings этот скрипт на фонарик!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! using System.Collections; using System.Collections.Generic; using UnityEngine; public class LightSetings : MonoBehaviour { public GameObject LumLight; public GameObject Lum; private void Update() { if (Lum.activeInHierarchy == true) { if (LumLight.activeInHierarchy == false) { if (Input.GetKey(KeyCode.G)) { LumLight.SetActive(true); } else { } } else { } } else { } if (Lum.activeInHierarchy == true) { if (LumLight.activeInHierarchy == true) { if (Input.GetKeyDown(KeyCode.F)) { LumLight.SetActive(false); } else { } } else { } } else { } } }