From 4ef15f3a143b751dc0a377daf7dd7bdf71f43459 Mon Sep 17 00:00:00 2001 From: Yoshifumi Kawai Date: Wed, 15 Apr 2020 15:23:23 +0900 Subject: [PATCH] test streamingassets --- Assets/Scenes/SandboxMain.cs | 17 +++++------------ Assets/StreamingAssets.meta | 8 ++++++++ Assets/StreamingAssets/test.txt | 1 + Assets/StreamingAssets/test.txt.meta | 7 +++++++ 4 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 Assets/StreamingAssets.meta create mode 100644 Assets/StreamingAssets/test.txt create mode 100644 Assets/StreamingAssets/test.txt.meta diff --git a/Assets/Scenes/SandboxMain.cs b/Assets/Scenes/SandboxMain.cs index 201a91b..1faf82d 100644 --- a/Assets/Scenes/SandboxMain.cs +++ b/Assets/Scenes/SandboxMain.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.IO; using System.Threading; using UniRx.Async; using UnityEngine; @@ -15,19 +16,11 @@ public class SandboxMain : MonoBehaviour async void Start() { - await UniTask.CompletedTask; // ok + UnityEngine.Debug.Log("DOWNLOAD START:" + Time.frameCount); - // var subject = new Subject(); - //subject.OnCompleted(); - IObservable subject = default; - try - { - await subject.ToUniTask(); // exception - } - catch (Exception exception) - { - Debug.Log(exception); - } + var req = await UnityWebRequest.Get(Path.Combine(Application.streamingAssetsPath, "test.txt")).SendWebRequest(); + + UnityEngine.Debug.Log("DOWNLOAD RESULT:" + Time.frameCount + ", " + req.downloadHandler.text); } } diff --git a/Assets/StreamingAssets.meta b/Assets/StreamingAssets.meta new file mode 100644 index 0000000..4d1953d --- /dev/null +++ b/Assets/StreamingAssets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7bb6ff9f1f0d0cd4da5ba7623f10dd6b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/test.txt b/Assets/StreamingAssets/test.txt new file mode 100644 index 0000000..e6fe8fd --- /dev/null +++ b/Assets/StreamingAssets/test.txt @@ -0,0 +1 @@ +MyTEST \ No newline at end of file diff --git a/Assets/StreamingAssets/test.txt.meta b/Assets/StreamingAssets/test.txt.meta new file mode 100644 index 0000000..dc3dcc7 --- /dev/null +++ b/Assets/StreamingAssets/test.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7fc83f79aef22a2449d5e9ca4964b2e0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: