You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
997 B

using Networking.Server;
using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
public class winnerscene : MonoBehaviour
{
public ClientList clientDataList;
public ServerObject serverObj;
public GameObject winname;
public Transform characterPosition;
private void Awake()
{
//GameObject character = Resources.Load<>
GameObject prefab = Resources.Load<GameObject>(GlobalVariables.winneranimal);
GameObject character = Instantiate(prefab, characterPosition);
character.transform.rotation = Quaternion.Euler(0, 152.775f, 0);
winname.GetComponent<TextMeshProUGUI>().text = GlobalVariables.winnername;
StartCoroutine(displayforSeconds());
}
IEnumerator displayforSeconds()
{
clientDataList.server.DisconnectAllConnections();
yield return new WaitForSeconds(10.0f);
serverObj.ServerClose();
SceneManager.LoadScene("MainMenu Server");
}
}