泛型子类中重写了基类的方法,在子类的另一个方法中调用了这个重写方法,使用injectfix修改这个方法后会导致调用到基类方法
泛型子类中重写了基类的方法,在子类的另一个方法中调用了这个重写方法。使用injectfix修改这个方法后会导致调用到基类方法,这个问题有修复过吗?在什么版本修复的==
public abstract class TestBase<T> : MonoBehaviour
{
public abstract void TestAbstract();
public virtual void TestVirtual()
{
Debug.Log("==========================TestBase.TestVirtual");
}
}
public class TestSub : TestBase<long>
{
public override void TestAbstract()
{
Debug.Log("======================TestSub.TestAbstract");
}
public override void TestVirtual()
{
Debug.Log("======================TestSub.TestVirtual");
}
[IFix.Patch]
public void TestInjectFix()
{
try
{
Debug.Log("=============================TestInjectFix1");
TestVirtual();
Debug.Log("=============================TestInjectFix2");
TestAbstract();
}
catch (Exception e)
{
Debug.LogError($"==================Error:{e}");
}
}
private void OnEnable()
{
TestInjectFix();
}
}
输出: 05-20 21:58:20.093: I/Unity(28399): =============================TestInjectFix1 05-20 21:58:20.096: I/Unity(28399): ==========================TestBase.TestVirtual 05-20 21:58:20.100: I/Unity(28399): =============================TestInjectFix2 05-20 21:58:20.116: E/Unity(28399):==================Error:System.ExecutionEngineException: Attempting to call method 'MG.TestSub[[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]::TestAbstract' for which no ahead of time (AOT) code was generated.
https://github.com/Tencent/InjectFix/pull/231 这个版本修复了
好的谢谢
------------------ 原始邮件 ------------------ 发件人: "Tencent/InjectFix" @.>; 发送时间: 2021年11月9日(星期二) 晚上8:08 @.>; @.@.>; 主题: Re: [Tencent/InjectFix] 泛型子类中重写了基类的方法,在子类的另一个方法中调用了这个重写方法,使用injectfix修改这个方法后会导致调用到基类方法 (#314)
#231 这个版本修复了
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.