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