Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated readme examples based on changes, and added clarity in places. #75

Merged
merged 4 commits into from
May 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added else validations
  • Loading branch information
SimonDarksideJ committed May 4, 2024
commit 245064a73f942f793c19a84d02639439f7383ba1
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ if (Rest.TryGetDownloadCacheItem(uri, out var cachedFilePath))
Debug.Log($"Deleted {cachedFilePath}");
}
}
else
{
Debug.Log($"Unable to download from {uri}");
}

// Clear the whole download cache directory
Rest.DeleteDownloadCache();
Expand All @@ -206,6 +210,10 @@ if (!string.IsNullOrWhiteSpace(downloadedFilePath) && File.Exists(downloadedFile
{
Debug.Log(downloadedFilePath);
}
else
{
Debug.Log($"Unable to download file to {downloadedFilePath}");
}
```

Download a file, and get the raw byte data.
Expand All @@ -217,6 +225,10 @@ if (downloadedBytes != null && downloadedBytes.Length > 0)
{
Debug.Log(downloadedBytes.Length);
}
else
{
Debug.Log($"Unable to download file");
}
```

Download raw file bytes.
Expand All @@ -230,6 +242,10 @@ if (downloadedBytes != null && downloadedBytes.Length > 0)
{
Debug.Log(downloadedBytes.Length);
}
else
{
Debug.Log($"Unable to download file");
}
```

#### Textures
Expand All @@ -244,6 +260,10 @@ if (texture != null)
// assign it to your renderer
rawImage.texture = texture;
}
else
{
Debug.Log($"Unable to download texture");
}
```

#### Audio
Expand All @@ -259,6 +279,10 @@ if (audioClip != null)
audioSource.clip = audioClip;
audioSource.PlayOneShot(audioClip);
}
else
{
Debug.Log($"Unable to download audio clip");
}
```

##### Audio Streaming
Expand Down Expand Up @@ -289,4 +313,8 @@ if (assetBundle != null)
var cube = assetBundle.LoadAsset<GameObject>("Cube");
Instantiate(cube);
}
else
{
Debug.Log($"Unable to download asset bundle");
}
```