"Ran out of trampolines of type 0/1/2" 運行時間錯誤通常出現在使用大量遞歸泛型時。要看到這個錯誤需要連接着設備直接將項目build到設備里運行調試才能看到,您可以暗示 AOT 編譯器分配更多type 0、type 1 或 type 2 trampolines。此外,AOT 編譯器命令行選項可以在播放器設置 (Player Settings)的其他設置 (Other Setings) 部分指定。對於 type 1 trampolines,指定 nrgctx-trampolines=ABCD,其中 ABCD 是新的 trampolines 所需的值(如 4096)。對於 type 2 trampolines,指定 nimt-trampolines=ABCD,對於 type 0 trampolines,指定 ntrampolines=ABCD。
同時設置多個方式如下:nrgctx-trampolines=8192,nimt-trampolines=8192,ntrampolines=8192
Explanation
nrgctx-trampolines=8096 (these are recursive generics – the default is 1024)
nimt-trampolines=8096 (these are to do with interfaces and the default is 128)
ntrampolines=4048 (are to do with generic method calls, by default there are 1024)
引用自:http://whydoidoit.com/2012/08/20/unity-serializer-mono-and-trampolines/