using System.Collections; using System.Collections.Generic; using Photon.Pun; using TMPro; using UnityEngine; public class ConnectingPanel : MonoBehaviour { public TMP_Text txt; void Start() { if(!PhotonNetwork.IsConnected){ StartCoroutine(SelfDestruct()); }else{ Destroy(gameObject); } } IEnumerator SelfDestruct(){ int j=0; while(!PhotonNetwork.InLobby){ j++; txt.text = "Connecting"; for(int i=0; i< j; i++){ txt.text += "."; } if(j>5){j=0;} yield return new WaitForSeconds(0.5f); } Destroy(gameObject); } }