InjectFix icon indicating copy to clipboard operation
InjectFix copied to clipboard

项目中,使用iFixInject,有个struct的数据拷贝没有成功执行

Open 354247879 opened this issue 4 years ago • 1 comments

距离,大佬不理我,已经好久好久了

354247879 avatar Jan 13 '21 07:01 354247879

namespace IFix.Test { public struct NormalTest { public int structInt; public void CopyData(NormalTest data) { Debug.Log("CopyData data.structInt ===>" + data.structInt); structInt = data.structInt; Debug.Log("CopyData structInt ===>" + structInt); } }

//HelloworldCfg.cs里配置了这个类型
public class Calculator
{
    public NormalTest StructTest;

    //[IFix.Patch]
    public void TestStructPatch(int idata)
    {
        //Debug.Log(" <color=red>PatchMode ==============================>> </color>");
        NormalTest current;
        current.structInt = idata;

        Debug.Log(" <color=red>Before</color> ==============================>> " + StructTest.structInt);
        StructTest.CopyData(current);
        Debug.Log(" <color=red>After </color> ==============================>> " + StructTest.structInt);
    }
}

11

354247879 avatar Mar 02 '21 07:03 354247879