private IEnumerator LoadFile(string url) { WWW loader = new WWW(url); yield return(loader); if (!compressed) { onFileSelected.Invoke(url, loader.bytes); onFileSelectedText.Invoke(url, loader.text); } else { byte[] data = FileUtils.UncompressDeflate(loader.bytes); onFileSelected.Invoke(url, data); onFileSelectedText.Invoke(url, Encoding.UTF8.GetString(data)); } }
// Sends event on file select using path // Then destroys the file browser // [Checked for null. ~K] private void SendFileSelectEvent(string path) { OnFileSelect?.Invoke(path); Destroy(); }
private void ButtonClicked() { onClicked.Invoke(this); }