from github
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user