in storage/testapp/Assets/Firebase/Sample/Storage/UIHandler.cs [499:618]
void GUIDisplayControls() {
if (UIEnabled) {
controlsScrollViewVector = GUILayout.BeginScrollView(controlsScrollViewVector);
GUILayout.BeginVertical();
GUILayout.Label("Text:");
if (fileContents == null)
fileContents = "Sample text... (type here)";
// Track changes in the downloaded file.
if (fileContents != previousFileContents) {
previousFileContents = fileContents;
// TextArea can only display a subset of the file contents so limit what is displayed.
editableFileContents = fileContents;
if (editableFileContents.Length > kMaxLogSize) {
editableFileContents = editableFileContents.Substring(0, kMaxLogSize);
}
}
fileContentsScrollViewVector = GUILayout.BeginScrollView(
fileContentsScrollViewVector, GUILayout.MinHeight(textAreaLineHeight * 6));
var newEditableFileContents = GUILayout.TextArea(editableFileContents);
GUILayout.EndScrollView();
// Only update the file contents if it was edited, allowing the start of the file to be
// modified.
if (newEditableFileContents != editableFileContents) {
fileContents = newEditableFileContents +
(fileContents.Length > kMaxLogSize ? fileContents.Substring(kMaxLogSize) : "");
}
GUILayout.Space(10);
GUILayout.Label("MetadataChange: (Key=Value)");
metadataScrollViewVector = GUILayout.BeginScrollView(
metadataScrollViewVector, GUILayout.MinHeight(textAreaLineHeight * 3));
fileMetadataChangeString = GUILayout.TextArea(fileMetadataChangeString);
GUILayout.EndScrollView();
GUILayout.Space(10);
GUILayout.Label("Local File Path:");
localFilename = GUILayout.TextField(localFilename);
GUILayout.Label("Storage Location:");
if (String.IsNullOrEmpty(storageLocation)) {
storageLocation = MyStorageBucket + "File.txt";
}
storageLocationScrollViewVector = GUILayout.BeginScrollView(
storageLocationScrollViewVector, GUILayout.MinHeight(textAreaLineHeight * 2));
storageLocation = GUILayout.TextArea(storageLocation);
GUILayout.EndScrollView();
GUILayout.Space(10);
GUILayout.BeginVertical();
if (Button("Upload", !operationInProgress)) {
StartCoroutine(UploadBytes());
}
if (Button("Upload Stream", !operationInProgress)) {
StartCoroutine(UploadStream());
}
if (Button("Upload from File", !operationInProgress)) {
StartCoroutine(UploadFromFile());
}
if (Button("Update Metadata", !operationInProgress)) {
StartCoroutine(UpdateMetadata());
}
GUILayout.Space(5);
if (Button("Download Bytes", !operationInProgress)) {
StartCoroutine(DownloadBytes());
}
if (Button("Download Stream", !operationInProgress)) {
StartCoroutine(DownloadStream());
}
if (Button("Download to File", !operationInProgress)) {
StartCoroutine(DownloadToFile());
}
if (Button("Get Metadata", !operationInProgress)) {
StartCoroutine(GetMetadata());
}
if (Button("Get Download URL", !operationInProgress)) {
StartCoroutine(ShowDownloadUrl());
}
GUILayout.Space(5);
if (Button("Delete", !operationInProgress)) {
StartCoroutine(Delete());
}
GUILayout.Space(10);
GUILayout.Label("Retry Configuration");
GUILayout.BeginHorizontal();
GUILayout.Label("Max Download Retry Time (ms):");
if (storage != null) {
storage.MaxDownloadRetryTime = GUIDisplayTimespanMsField(storage.MaxDownloadRetryTime);
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Label("Max Operation Retry Time (ms):");
if (storage != null) {
storage.MaxOperationRetryTime = GUIDisplayTimespanMsField(storage.MaxOperationRetryTime);
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Label("Max Upload Retry Time (ms):");
if (storage != null) {
storage.MaxUploadRetryTime = GUIDisplayTimespanMsField(storage.MaxUploadRetryTime);
}
GUILayout.EndHorizontal();
GUILayout.Space(10);
GUILayout.EndVertical();
GUILayout.EndVertical();
GUILayout.EndScrollView();
}
}