//triggers when another object enters its area. private void OnTriggerEnter(Collider other) { if (NetworkManager.singleton == null) { return; } if (other.gameObject.tag == "Player") { fader.duration = 0.8f; StartCoroutine(fader.FadeToBlackAndDo(Host())); } }
//triggers when another object enters its area. private void OnTriggerEnter(Collider other) { //if object is player then load scene if (other.gameObject.tag == "Player" && joined == false) { if (fader == null) { StartCoroutine(Join()); } else { joined = true; StartCoroutine(fader.FadeToBlackAndDo(Join())); } } }