public class CursorOptions : MonoBehaviour
{
public GameObject menuPaused;
public GameObject inv;
// Start is called before the first frame update
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}
// Update is called once per frame
void Update()
{
if (menuPaused.SetActive(true) || inv.SetActive(true))
{
Cursor.lockState = CursorLockMode.None;
}
else
{
Cursor.lockState = CursorLockMode.Locked;
}
}
}
menuPaused.SetActive(true)
menuPaused.activeSelf // это если тру
!menuPaused.activeSelf // это если false
menuPaused.activeSelf == true
menuPaused.activeSelf == false