private void Start() { if (Instance == null) { Instance = this; _updateNicknamePanel = new UnityEvent(); } else { Destroy(GetComponent <MultiplayerFunctions>()); } PhotonNetwork.AutomaticallySyncScene = true; }
private static HostData[] hostData = null; //Latest cached hostData result void Awake() { if (SP != null && this != SP) { //There is already a copy of this script running Destroy(this); return; } SP = this; StartCoroutine(TestConnection()); StartCoroutine(SetupMasterServer()); //DontDestroyOnLoad(this); //enable this to make this an persistent GO }
void Awake() { if (SP != null && this != SP) { //There is already a copy of this script running Destroy(this); return; } SP = this; StartCoroutine(TestConnection()); StartCoroutine(SetupMasterServer()); //DontDestroyOnLoad(this); //enable this to make this an persistent GO }