更改文件架构
This commit is contained in:
21
Packages/Common~/Scripts/Debuger/UnityWebRequestGetAsync.cs
Normal file
21
Packages/Common~/Scripts/Debuger/UnityWebRequestGetAsync.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine.Networking;
|
||||
using Cysharp.Threading.Tasks;
|
||||
namespace BITKit
|
||||
{
|
||||
public class UnityWebRequestGetAsync : BITBehavior
|
||||
{
|
||||
public string url;
|
||||
[TextArea] public string result;
|
||||
[Button]
|
||||
async void Excute()
|
||||
{
|
||||
var request = UnityWebRequest.Get(url);
|
||||
await request.SendWebRequest();
|
||||
result = request.downloadHandler.text;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user