Unity 序列化深度限制解决方式


问题:

Serialization depth limit 10 exceeded at 'BTFramework::BTNodeData.ChildNodeList'. There may be an object composition cycle in one or more of your serialized classes.

Serialization depth limit exceeded at '‘. There may be an object composition cycle in one or more of your serialized classes.

向下面这种有自己引用自己的类会出现上面的问题

[System.Serializable]
public class Node
{
    public Node Next;
}

解决方式一:

  https://docs.unity3d.com/Manual/script-Serialization-Custom.html

  https://docs.unity3d.com/ScriptReference/ISerializationCallbackReceiver.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM