So, if you know Jeremy Gibson, he has 2 books about entering to Level Game Design in Unity. In the book, there is a prototype tutorial for a solitaire game.
well, I have an error on the script Prospector.cs regarding a variable that derives from the script Deck.
The error is a NullReference, here is a snip of the code.
The error is in the line of cp.faceUp = tSD.faceUp;
foreach(SlotDef tSD in layout.slotDefs)
{
// ^ iterate through all the SlotDefs in the Layout.slotDefs as tSD
cp = Draw(); // Pull a card from the top (beginning) of the draw Pile
cp.faceUp = tSD.faceUp; // Set its faceUp to the value in SlotDef
cp.transform.parent = layoutAnchor; // Make its parent LayoutAnchor
// This replaces the previous parent: deck.deckAnchor, which
// appears as _Deck in the Hierarchy when the scene is playing.
cp.transform.localPosition = new Vector3(
layout.multiplier.x * tSD.x,
layout.multiplier.y * tSD.y,
-tSD.layerID);
// ^ Set the LocalPosition of the card based on slotDef
cp.layoutID = tSD.id;
cp.slotDef = tSD;
// CardProspectors in the tableau have the state CardState. tableau
cp.state = eCardState.tableau;
tableau.Add(cp); // Add this CardProspector to the List<> tableau
}
I don’t know what did I do wrong. But if someone is so gentle to help me I will link my GitHub repo here.:
https://github.com/Dreaddisk/Prospector-Solitaire