You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public struct TestStructA
{
public long value;
}
public struct TestStructB
{
public TestStructA m1;
public TestStructA m2;
public TestStructA m3;
public TestStructA m4;
public TestStructA m5;
public TestStructA m6;
public TestStructA m7;
public TestStructA m8;
public TestStructA m9;
public static TestStructB GetOne(TestStructA a)
{
TestStructB ret = default;
ret.m1 = new TestStructA { value = 1 };
ret.m2 = new TestStructA { value = 2 };
ret.m3 = new TestStructA { value = 3 };
ret.m4 = new TestStructA { value = 4 };
ret.m5 = new TestStructA { value = 5 };
ret.m6 = new TestStructA { value = 6 };
ret.m7 = new TestStructA { value = 7 };
ret.m8 = new TestStructA { value = 8 };
ret.m9 = new TestStructA { value = 9 };
return ret;
}
public override string ToString()
{
return $"{m1.value}|{m2.value}|{ m3.value}|{ m4.value}|{ m5.value}|{ m6.value}|{ m7.value}|{ m8.value}|{ m9.value}";
}
}
对应写了binder
热更域里这么使用:
namespace HotFix
{
public static class HotFixLauncher
{
public static void Test()
{
MinCirclePath path = new MinCirclePath();
path.Test();
}
}
public class MinCirclePath
{
private TestStructB mAttr;
public void Test()
{
mAttr = GetAttr();
Debug.Log(mAttr);
}
private TestStructB GetAttr()
{
var a = new TestStructA() { value = 5 };
//这样写不会错
//var ret = TestStructB.GetOne(a);
//return ret;
//这样直接返回就会错
return TestStructB.GetOne(a);
}
}
}
外部值类型定义如下:
对应写了binder
热更域里这么使用:
做了CLR方法绑定,并且热更代码编译一定要勾选上Optimize Code为true才会错。
指令上看不勾选只多了
1.6.7和2.0.2都有这个问题,unity2019.4
TestError.zip
例子工程里任意场景运行即可复现。
The text was updated successfully, but these errors were encountered: