123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Reflection;
- using System.Threading.Tasks;
- using UnityEngine;
- using UnityEngine.Networking;
- public class LoadDll : MonoBehaviour
- {
- void Start()
- {
- StartCoroutine(SendHttp("https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/HotUpdate.dll.bytes"));
- }
- public IEnumerator SendHttp(string url)
- {
- Debug.Log("HybridCLRStart1");
- UnityWebRequest webRequest = UnityWebRequest.Get(url);
- webRequest.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
- yield return webRequest.SendWebRequest();
- if (webRequest.isDone)
- {
- Assembly hotUpdateAss = Assembly.Load(webRequest.downloadHandler.data);
- Debug.Log("HybridCLRStart2");
- Type type = hotUpdateAss.GetType("Hello");
- Debug.Log("HybridCLRStart3");
- type.GetMethod("Run").Invoke(null, null);
- Debug.Log("HybridCLRStart4");
- }
- }
- }
|