So, in my game I have a class which looks like this:
[System.Serializable]
public class Part{
//
}
This then becomes a BinaryFormatted file.
However, I need it to be able to hold a List in case new parts are attached to it:
[System.Serializable]
public class Part{
List<Part> attachedParts;
//
}
This of course doesn’t work properly because of the depth limit.
Constraint 1: It can’t become a monobehaviour.
Constraint 2: It can’t become a ScriptableObject.
Note 1: When I instantiate a part, the list of parts attached to it can be null or have a count of 0.
Note 2: The depth will never exceed 5 in my the game. So it is not infinite.
Note 3: I don’t care about which formatter to use (binary, xml, json)
Question 1: Is there a way to “hard” set a limit so that I get around this problem?
EDIT 1: Accidentally pressed hotkey and published the thread before finishing to write it. According to this we can’t delete posts. So I suppose this will stay published until I finish writing it. Sorry for the trouble.
EDIT 2: Done.