30 lines
688 B
C#
30 lines
688 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
using System.Net;
|
|
using System.Net.Sockets;
|
|
|
|
public class NetworkHostFunction : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
public void Start()
|
|
{
|
|
GetComponent<Button>().onClick.AddListener(() =>
|
|
{
|
|
setNetworkData();
|
|
SceneManager.LoadScene("ClassRoom");
|
|
});
|
|
}
|
|
|
|
//make the current client host (client + server at the same time)
|
|
public void setNetworkData()
|
|
{
|
|
PlayerPrefs.SetString("status", "host");
|
|
PlayerPrefs.Save();
|
|
}
|
|
|
|
}
|