protected virtual void OnDestroy() { if (Instance == this) { Instance = null; } }
protected virtual void Awake() { if (Instance != null) { VRDF_Components.DebugVRDFMessage("Another instance of VRDFConnectionManager exist. Be sure to only have one VRDFConnectionManager in your Scene.", true); Destroy(this); return; } Instance = this; PhotonNetwork.AutomaticallySyncScene = _automaticallySyncScene; // Check for when the user just left a room and is coming back to the Connection Scene if (!PhotonNetwork.IsConnectedAndReady) { // Connect to Photon Online Server VRDF_Components.DebugVRDFMessage("Connecting with Photon Server ..."); PhotonNetwork.ConnectUsingSettings(); } }