using Fusion; using UnityEngine; public class TriggerTest : MonoBehaviour { [SerializeField] bool _goOffline = true; [SerializeField] bool _isTriggered = false; private void OnTriggerEnter(Collider other) { if(_goOffline) { if(other.gameObject.layer == 6) { NetworkObject player = other.GetComponentInParent(); if(player.HasInputAuthority && _isTriggered is false) { _isTriggered = true; Debug.Log($"{player.name}"); GameManager.Instance.GoOffline(); }//if end }//if end }//if end else { if(other.gameObject.layer == 6) { TopDownPlayerOffline offlinePlayer = other.GetComponentInParent(); if(offlinePlayer != null) { _isTriggered = true; Debug.Log($"{offlinePlayer.name}"); GameManager.Instance.GoOnline(); }//if end }//if end }//else end }//OnTriggerEnter() end }//class end