Ejemplo n.º 1
0
 //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()));
     }
 }
Ejemplo n.º 2
0
 //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()));
         }
     }
 }