mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-16 20:20:45 +00:00
test streamingassets
This commit is contained in:
@@ -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<Unit>();
|
||||
//subject.OnCompleted();
|
||||
IObservable<AsyncUnit> 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
8
Assets/StreamingAssets.meta
Normal file
8
Assets/StreamingAssets.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bb6ff9f1f0d0cd4da5ba7623f10dd6b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1
Assets/StreamingAssets/test.txt
Normal file
1
Assets/StreamingAssets/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
MyTEST
|
||||
7
Assets/StreamingAssets/test.txt.meta
Normal file
7
Assets/StreamingAssets/test.txt.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fc83f79aef22a2449d5e9ca4964b2e0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user