// Make cd the new target card void MoveToTarget(CardProspector cd) { // If there is currently a target card, move it to discardPile if (target != null) { MoveToDiscard(target); } target = cd; // cd is the new target cd.state = eCardState.target; cd.transform.parent = layoutAnchor; // Move to the target position cd.transform.localPosition = new Vector3( layout.multiplier.x * layout.discardPile.x, layout.multiplier.y * layout.discardPile.y, -layout.discardPile.layerID); cd.faceUp = true; // Make it face-up // Set the depth sorting cd.SetSortingLayerName(layout.discardPile.layerName); cd.SetSortOrder(0); cd.printCard(); }