tuyoogame / huatuo

huatuo是一个特性完整、零成本、高性能、低内存的近乎完美的Unity全平台原生c#热更方案。 Huatuo is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotfix
MIT License
2.31k stars 377 forks source link

继承泛型类闪退,但是将泛型类放到热更层就正常 #33

Closed wumiao1990 closed 2 years ago

wumiao1990 commented 2 years ago

AOT代码

public interface IStateOwner
{
     Task TranslateState<TState>(object[] args);
}
public abstract class State <TOwner> where TOwner: IStateOwner
{
    public abstract Task OnEnter();

}

热更层代码

public class GameManager: IStateOwner
{
    public Task TranslateState<TState>(object[] args)
    {
        throw new NotImplementedException();
    }
}
public class GameState_Version : State<GameManager>
{
    public override  Task OnEnter()
    {
        Debug.Log("GameState_Version->OnEnter");
        return null;
    }
}
pirunxi commented 2 years ago

确认。已修复。