NetworkChecker.cs 531 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Mirror;
  5. using HQFPSWeapons;
  6. public class NetworkChecker : MonoBehaviour
  7. {
  8. public GameObject networkErrorPanel;
  9. public PlayerInput_PC inputs;
  10. void Update()
  11. {
  12. if(FindObjectOfType<NetworkManager>()==null){
  13. networkErrorPanel.SetActive(true);
  14. inputs.enabled = false;
  15. }else{
  16. networkErrorPanel.SetActive(false);
  17. inputs.enabled = true;
  18. }
  19. }
  20. }