Giter VIP home page Giter VIP logo

Comments (2)

Jihuihu avatar Jihuihu commented on May 8, 2024

这里是HotFixTest.cs的 TestRun方法

[Patch]
        public string TestRun()
        {
            string old = "Old Run";
            Debug.Log("debug:"+ old);
            return old;
        }

这里是 LogicMgr.cs中下载并呼叫TestRun的代码

    private void RunFunction()
    {
        var msg = TestRunGo.TestRun();
        Log(msg);
        Debug.Log("RunFun End"+msg);
    }

这个是一个Log方法,只是把字符串显示到场景中

 public void Log(string msg)
    {
        MsgText.text = MsgText.text + msg + "\n-";
        UnityEngine.Debug.Log("Log End:"+msg);
    }

这里是 LogicMgr.cs中下载并LoadPatch的代码

   IEnumerator DownLoadAndLoadPatch(string patchStr)
    {
        UnityWebRequest www = UnityWebRequest.Get(patchStr);
        yield return www.SendWebRequest();

        if (www.isNetworkError || www.isHttpError)
        {
            Log(www.error);
        }
        else
        {
            // Or retrieve results as binary data
            byte[] results = www.downloadHandler.data;

            Log("loading " + patchStr);
            var sw = Stopwatch.StartNew();
            PatchManager.Load(new MemoryStream(results));
            Log(string.Format("{0}, using {1} msg", patchStr, sw.ElapsedMilliseconds));
        }
    }

from injectfix.

Jihuihu avatar Jihuihu commented on May 8, 2024

这个问题突然又好了,我没有做别的,只是为了 贴出代码,把方法做了一次重命名
再次测试 竟然通过了

from injectfix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.