示例#1
0
        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));
            }
        }
示例#2
0
 // 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();
 }
示例#3
0
 private void ButtonClicked()
 {
     onClicked.Invoke(this);
 }