void Start() { externalReceiver = GetComponent <EVMC4U.ExternalReceiver>(); client = GetComponent <SEDSS_Client>(); client.SetAddress(Address); client.SetPassword(password); if (externalReceiver != null) { client.Download(id, (data, id) => { externalReceiver?.LoadVRMFromData(data); Debug.Log("Download OK id:" + id); }, (e, id) => { Error = e; Debug.Log("Download Error id:" + id); }); } if (File.Exists(UploadFilePath)) { byte[] data = File.ReadAllBytes(UploadFilePath); Debug.Log(data.Length); client.Upload(data, id, (id) => { Debug.Log("Upload OK id:" + id); }, (e, id) => { Error = e; Debug.Log("Upload Error id:" + id); }); } }
void Start() { externalReceiver = GetComponent <EVMC4U.ExternalReceiver>(); server = GetComponent <SEDSS_Server>(); server.SetPassword(password); server.StartServer(); server.OnDownloadRequest = (id) => { Debug.Log("Server responced"); return(File.ReadAllBytes(SendFilePath)); }; server.OnDataUploaded = (data, id) => { Debug.Log("Server received"); externalReceiver?.LoadVRMFromData(data); }; }