void MoveToDiscard(CardProspector cd) { cd.state = eCardState.discard; discardPile.Add(cd); cd.transform.parent = layoutAnchor; cd.transform.localPosition = new Vector3( layout.multiplier.x * layout.discardPile.x, layout.multiplier.y * layout.discardPile.y, -layout.discardPile.layerID + 0.5f); cd.faceUp = true; cd.SetSortingLayerNames(layout.discardPile.layerName); cd.setSortOrder(-100 + discardPile.Count); }
void MoveToTarget(CardProspector cd) { if (target != null) { MoveToDiscard(target); } target = cd; cd.state = eCardState.target; cd.transform.parent = layoutAnchor; cd.transform.localPosition = new Vector3( layout.multiplier.x * layout.discardPile.x, layout.multiplier.y * layout.discardPile.y, -layout.discardPile.layerID); cd.faceUp = true; cd.SetSortingLayerNames(layout.discardPile.layerName); cd.setSortOrder(0); }